Skip to content

Commit ebd8809

Browse files
newrengitster
authored andcommitted
completion: squelch stray errors in sparse-checkout completion
If, in the root of a project, one types git sparse-checkout set --cone ../<TAB> then an error message of the form fatal: ../: '../' is outside repository at '/home/newren/floss/git' is written to stderr, which munges the users view of their own command. Squelch such messages by using the __git() wrapper, designed for this purpose; see commit e15098a (completion: consolidate silencing errors from git commands, 2017-02-03) for more on the wrapper. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 564d025 commit ebd8809

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/completion/git-completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3084,7 +3084,7 @@ __gitcomp_directories ()
30843084
COMPREPLY+=("$c/")
30853085
_found=1
30863086
fi
3087-
done < <(git ls-tree -z -d --name-only HEAD $_tmp_dir)
3087+
done < <(__git ls-tree -z -d --name-only HEAD $_tmp_dir)
30883088

30893089
if [[ $_found == 0 ]] && [[ "$cur" =~ /$ ]]; then
30903090
# No possible further completions any deeper, so assume we're at

0 commit comments

Comments
 (0)