@matheusbsbs / matheus-bagliano / commits / 51fe120903
Fork 0

bash: use __gitdir when completing 'git rebase' options

When doing completion of rebase options in a subdirectory of the work tree during an ongoing rebase, wrong options were offered because of the hardcoded .git/.dotest-merge path. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

SZEDER Gábor committed Mar 6, 2008 at 22:37 UTC 51fe120903370ca8bf384c839c8cfb70ee563eb0
1 file changed +2 -2
contrib/completion/git-completion.bash
+2 -2
@@ -841,8 +841,8 @@ _git_push ()
841
842 _git_rebase ()
843 {
844 - local cur="${COMP_WORDS[COMP_CWORD]}"
845 - if [ -d .dotest ] || [ -d .git/.dotest-merge ]; then
844 + local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)"
845 + if [ -d .dotest ] || [ -d "$dir"/.dotest-merge ]; then
846 __gitcomp "--continue --skip --abort"
847 return
848 fi