summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-18 09:23:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-18 09:23:59 (GMT)
commit7bdebaa646787b98679799ee27bfb42fb7daa8ca (patch)
treeff6dc6265ac51f3af6c58d736311166839857ec0 /t
parent56e4af3d34f95724ac26147f26752fa90d9e0280 (diff)
parent47bd3d0c14f081a3ea32b0720f7d59559802904d (diff)
downloadgit-7bdebaa646787b98679799ee27bfb42fb7daa8ca.zip
git-7bdebaa646787b98679799ee27bfb42fb7daa8ca.tar.gz
git-7bdebaa646787b98679799ee27bfb42fb7daa8ca.tar.bz2
Merge branch 'sg/ref-filter-wo-repository'
"git ls-remote --sort=<thing>" can feed an object that is not yet available into the comparison machinery and segfault, which has been corrected to check such a request upfront and reject it. * sg/ref-filter-wo-repository: ref-filter: don't look for objects when outside of a repository
Diffstat (limited to 't')
-rwxr-xr-xt/t5512-ls-remote.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh
index 91ee684..32e722d 100755
--- a/t/t5512-ls-remote.sh
+++ b/t/t5512-ls-remote.sh
@@ -302,6 +302,12 @@ test_expect_success 'ls-remote works outside repository' '
nongit git ls-remote dst.git
'
+test_expect_success 'ls-remote --sort fails gracefully outside repository' '
+ # Use a sort key that requires access to the referenced objects.
+ nongit test_must_fail git ls-remote --sort=authordate "$TRASH_DIRECTORY" 2>err &&
+ test_i18ngrep "^fatal: not a git repository, but the field '\''authordate'\'' requires access to object data" err
+'
+
test_expect_success 'ls-remote patterns work with all protocol versions' '
git for-each-ref --format="%(objectname) %(refname)" \
refs/heads/master refs/remotes/origin/master >expect &&