completions/git: add more special refs

These are things like .git/HEAD, i.e. the ones that are typically not
namespaced under .git/refs.  The list is taken from gitrevisions(7).
This commit is contained in:
Johannes Altmanninger
2025-05-31 20:30:23 +02:00
parent 99f78fb0b1
commit cd45a8c5cc

View File

@@ -82,7 +82,8 @@ end
function __fish_git_heads
set -l gitdir (__fish_git rev-parse --git-dir 2>/dev/null)
or return # No git dir, no need to even test.
for head in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD
for head in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD REVERT_HEAD \
CHERRY_PICK_HEAD BISECT_HEAD AUTO_MERGE
if test -f $gitdir/$head
echo $head
end