diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-11-18 09:23:59 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-18 09:23:59 (GMT) |
commit | 7bdebaa646787b98679799ee27bfb42fb7daa8ca (patch) | |
tree | ff6dc6265ac51f3af6c58d736311166839857ec0 /t | |
parent | 56e4af3d34f95724ac26147f26752fa90d9e0280 (diff) | |
parent | 47bd3d0c14f081a3ea32b0720f7d59559802904d (diff) | |
download | git-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-x | t/t5512-ls-remote.sh | 6 |
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 && |