Learn more about these different git repos.
Other Git URLs
In pyrpkg/__init__.py, os.chdir is used to change to git repository to perform git and other operations. This makes code hard to understand a little and be errorprone. os.chdir should be avoid as much as possible. For example, in pyrpkg.Commands.diff, current directory is changed to self.path, and then perform git diff, that can be replace with using --git-dir.
pyrpkg/__init__.py
os.chdir
self.path
git diff
--git-dir
This is a worthwhile thing to fix. When a program needs to run in changed working directory, we could just set cwd via the function in subprocess. This would work even if the program does not have an option like --git-dir.
cwd
subprocess
We can't just remove os.chdir from pyrpkg. There may be downstream users who rely on working directory being changed.
RHBZ#1353699 is related to this issue.
I'm going to close this. Feel free reopen if it's necessary to fix in the future.
@cqi changed the status to Closed
Closed
Login to comment on this ticket.