]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5512-ls-remote.sh
Merge branch 'md/list-lazy-objects-fix'
[thirdparty/git.git] / t / t5512-ls-remote.sh
index 91ee6841c150f5b7c03e2624231b5344a1fa47e9..32e722db2ed96f14b6ca4b0fe53636c719f57eb5 100755 (executable)
@@ -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 &&