summaryrefslogtreecommitdiff
path: root/levenshtein.c
diff options
context:
space:
mode:
authorLibravatar SZEDER Gábor <szeder@ira.uka.de>2011-04-01 17:47:37 +0200
committerLibravatar SZEDER Gábor <szeder@ira.uka.de>2013-06-24 18:03:37 +0200
commitdd0b72cbd9e64c782a31c6acfca2ba9cf2ffb266 (patch)
tree0b4156276d1552a1a8b07c8af0e65b4294819d1d /levenshtein.c
parentbash prompt: use bash builtins to check for unborn branch for dirty state (diff)
downloadtgif-dd0b72cbd9e64c782a31c6acfca2ba9cf2ffb266.tar.xz
bash prompt: use bash builtins to check stash state
When the environment variable $GIT_PS1_SHOWSTASHSTATE is set __git_ps1() checks the presence of stashes by running 'git rev-parse --verify refs/stash'. This command not only checks that the 'refs/stash' ref exists but also, well, verifies that it's a valid ref. However, we don't need to be that thorough for the bash prompt. We can omit that verification and only check whether 'refs/stash' exists or not. Since 'git pack-refs' never packs 'refs/stash', it's a matter of checking the existence of a ref file. Perform this check using only bash builtins to spare the overhead of fork()+exec()ing a git process. Also run 'git pack-refs --all' in the corresponding test to document that the prompt script depends on 'git pack-refs' not packing 'refs/stash' and to catch possible breakages should this behavior ever change. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Diffstat (limited to 'levenshtein.c')
0 files changed, 0 insertions, 0 deletions