Skip to content

git.show raises an error when a file is passed as the second parameter #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
julianvargasalvarez opened this issue Dec 9, 2012 · 2 comments
Assignees

Comments

@julianvargasalvarez
Copy link

Hey if I perform:

repo.git.show('4aeba658ca4bb8dba3d7204b2931c7cb03d5be36', 'hello.txt')

it will raise an error when 'hello.txt' no longer exists. If I go to the terminal and perform:

git show '4aeba658ca4bb8dba3d7204b2931c7cb03d5be36' hello.txt

I get the same error but if I put two dashes, it works

git show '4aeba658ca4bb8dba3d7204b2931c7cb03d5be36' -- hello.txt

Notice: this happens when hello.txt was commited before and it is part of the history but if it does not exist in the working directory the error will be thrown unless we put two dashes before the filename

@Byron
Copy link
Member

Byron commented Dec 10, 2012

Thanks for posting - currently its a limitation in the way git commands are constructed, and I believe there is no easy workaround.

@Byron Byron added this to the v0.3.5 - bugfixes milestone Nov 19, 2014
@Byron Byron self-assigned this Jan 9, 2015
@Byron
Copy link
Member

Byron commented Jan 9, 2015

By now, I do believe there is an easy workaround, as you should be able to just add the double-dash as argument, such as follows:

repo.git.show('4aeba658ca4bb8dba3d7204b2931c7cb03d5be36', '--', 'hello.txt')

@Byron Byron closed this as completed Jan 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants