summaryrefslogtreecommitdiff
path: root/t/t0055-beyond-symlinks.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-06-14 11:35:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-15 19:31:43 (GMT)
commit69743f9b4f8411853e347fbd392221552b43fd12 (patch)
treefd9dfba846d5ac17ec92d51dfbb3aab34a8c4878 /t/t0055-beyond-symlinks.sh
parentb06d3643105c8758ed019125a4399cb7efdcce2c (diff)
downloadgit-69743f9b4f8411853e347fbd392221552b43fd12.zip
git-69743f9b4f8411853e347fbd392221552b43fd12.tar.gz
git-69743f9b4f8411853e347fbd392221552b43fd12.tar.bz2
discover_git_directory(): avoid setting invalid git_dir
When discovering a .git/ directory, we take pains to ensure that its repository format version matches Git's expectations, and we return NULL otherwise. However, we still appended the invalid path to the strbuf passed as argument. Let's just reset the strbuf to the state before we appended the .git/ directory that was eventually rejected. There is another early return path in that function, when setup_git_directory_gently_1() returns GIT_DIR_NONE or an error. In that case, the gitdir parameter has not been touched, therefore there is no need for an equivalent change in that code path. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0055-beyond-symlinks.sh')
0 files changed, 0 insertions, 0 deletions