You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I do git.Repo("../other_repo").git.rev_list('test ^master') when the pwd is a repo too, it runs it against the current repo not the specified one.
tested version
dunno if it's already been fixed, all my Unices are broken and I'm stuck on python 3.9 and can't check, hence the throwaway account. here's the output:
Test framework made me glaze over so here's a bash script:
#!/bin/bashset -e
# Install GitPython (you might want to use a venv here I guess)
pip install GitPython
# (re)create directories
rm -rf repo1 repo2
mkdir repo1 repo2
# Create empty README.md in each directory
touch repo1/README.md repo2/README.md
# Initialize and commit in repo1cd repo1
git init # broken by woken folken? should have forking spoken
git add README.md
git commit -m "Initial commit"# Create and checkout to a new branch 'test', modify README.md, and commit
git checkout -b testecho"Some text for the test branch">> README.md
git add README.md
git commit -m "Update README on test branch"# Go back to the parent directorycd ..
# Initialize and commit in repo2cd repo2
git init
git add README.md
git commit -m "Initial commit"# Run Python one-liner to get unique commits in the test branch compared to master in repo1 using rev_list
python -c "import git; repo = git.Repo('../repo1'); print(repo.git.rev_list('test ^master').split('\n'))"
expected result
return code of 0, no stack trace
actual result
...git.exc.GitCommandError: Cmd('git') failed due to: exit code(128) cmdline: git rev-list test ^master stderr: 'fatal: ambiguous argument 'test ^master': unknown revision or path not in the working tree.Use '--' to separate paths from revisions, like this:'git <command> [<revision>...] -- [<file>...]''
$ echo$?1
The text was updated successfully, but these errors were encountered:
Thanks a lot for reporting, and for providing a reproducer!
I took a quick look at the code but it wasn't immediately obvious why the git object would pick up the CWD.
Doing the same with git -C ../repo1 rev-list test ^main works, but doing git -C ../repo1 rev-list 'test ^main' produces exactly the message provided here.
problem
If I do
git.Repo("../other_repo").git.rev_list('test ^master')
when the pwd is a repo too, it runs it against the current repo not the specified one.tested version
dunno if it's already been fixed, all my Unices are broken and I'm stuck on python 3.9 and can't check, hence the throwaway account. here's the output:
code to reproduce
Test framework made me glaze over so here's a bash script:
expected result
return code of 0, no stack trace
actual result
The text was updated successfully, but these errors were encountered: