summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar SZEDER Gábor <szeder.dev@gmail.com>2017-02-03 03:48:19 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-02-03 22:18:40 -0800
commit62a1b732160c363a84be310f801b5dec59196b9c (patch)
tree4fca423596204c5cff6a46b36a1b528056497bc3 /t
parentcompletion: list refs from remote when remote's name matches a directory (diff)
downloadtgif-62a1b732160c363a84be310f801b5dec59196b9c.tar.xz
completion: don't list 'HEAD' when trying refs completion outside of a repo
When refs completion is attempted while not in a git repository, the completion script offers 'HEAD' erroneously. Check early in __git_refs() that there is either a repository or a remote to work on, and return early if neither is given. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t9902-completion.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index a201b52129..5b4defaa5c 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -599,7 +599,7 @@ test_expect_success '__git_refs - non-existing URL remote - full refs' '
test_must_be_empty "$actual"
'
-test_expect_failure '__git_refs - not in a git repository' '
+test_expect_success '__git_refs - not in a git repository' '
(
GIT_CEILING_DIRECTORIES="$ROOT" &&
export GIT_CEILING_DIRECTORIES &&