davidrjonas / composer-lock-diff

See what has changed after a composer update
MIT License
276 stars 18 forks source link

Git show does not expect windows directory separator #21

Open scaytrase opened 5 years ago

scaytrase commented 5 years ago

https://github.com/davidrjonas/composer-lock-diff/blob/817bb8f7e9177c87947e2e067e138ca93e8a4681/composer-lock-diff#L185

git show called here does not expect DIRECTORY_SEPARATOR in path. It always expect linux style separators (in general these starts to be revision notation, not a paths at all

So when I just call composer-lock-diff or composer-lock-diff --from="HEAD:.\composer.lock" it gives me

Error: contents from HEAD:.\composer.lock does not decode as json

If I manually provide it --from="HEAD:./composer.lock" it works well.

So I hope when play comes to git show we should forcibly replace directory separators to / ?

davidrjonas commented 5 years ago

I'm going to have to read more about how git works with windows paths before I can make a call here. Is it just the case that git always uses unix path separators and that building $fileish again with / explicitly in the git show case would cover it?

scaytrase commented 5 years ago

Looks like. Providing paths manually with / instead of guessed \ helps