git/contrib/completion
Stan Hu 44dbb3bf29 completion: support pseudoref existence checks for reftables
In contrib/completion/git-completion.bash, there are a bunch of
instances where we read pseudorefs, such as HEAD, MERGE_HEAD,
REVERT_HEAD, and others via the filesystem. However, the upcoming
reftable refs backend won't use '.git/HEAD' at all but instead will
write an invalid refname as placeholder for backwards compatibility,
which will break the git-completion script.

Update the '__git_pseudoref_exists' function to:

1. Recognize the placeholder '.git/HEAD' written by the reftable
   backend (its content is specified in the reftable specs).
2. If reftable is in use, use 'git rev-parse' to determine whether the
    given ref exists.
3. Otherwise, continue to use 'test -f' to check for the ref's filename.

Signed-off-by: Stan Hu <stanhu@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-12-19 15:11:58 -08:00
..
.gitattributes completion: mark bash script as LF-only 2017-05-10 13:32:51 +09:00
git-completion.bash completion: support pseudoref existence checks for reftables 2023-12-19 15:11:58 -08:00
git-completion.tcsh completion: tcsh: Fix regression by drop of wrapper functions 2021-08-18 13:58:27 -07:00
git-completion.zsh contrib/completion: fix zsh completion regression from 59d85a2a05 2021-06-02 12:49:40 +09:00
git-prompt.sh Merge branch 'ek/completion-use-read-r-to-read-literally' 2023-05-02 10:13:34 -07:00