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
in step 4, the tig completion completes refs from the current repository
Actual behaviour:
in step 4, the tig completion completes refs from the previous repository, not the current one
This is because the tig completion uses internals from the git completion, which caches the path to the git directory in the shell variable __git_repo_path. Inside the git completion, this variable is defined on the local call stack in __git_main(), but in the tig completion, this variable is not defined, so the variable stays global and is cached in the current shell session.
Workaround:
unset __git_repo_path after changing to another repo
Reminder to myself to refactor the tig bash completion so it stays more independent from the git-completion's internals… (I cannot assign myself to this issue because I'm not a maintainer, so feel free to do so.)
The text was updated successfully, but these errors were encountered:
Ah, apparently this is only a problem when the git repo is not .git, because in this case $__git_repo_path will be correct nevertheless. However, when using worktrees, the repo path can be something like ~/projects/linux/.git/worktrees/linux-maint, which will cause problems.
Steps to reproduce:
tig <Tab>
tig <Tab>
againExpected behaviour:
Actual behaviour:
This is because the tig completion uses internals from the git completion, which caches the path to the git directory in the shell variable
__git_repo_path
. Inside the git completion, this variable is defined on the local call stack in__git_main()
, but in the tig completion, this variable is not defined, so the variable stays global and is cached in the current shell session.Workaround:
unset __git_repo_path
after changing to another repoReminder to myself to refactor the tig bash completion so it stays more independent from the git-completion's internals… (I cannot assign myself to this issue because I'm not a maintainer, so feel free to do so.)
The text was updated successfully, but these errors were encountered: