Code

Merge branch 'ks/sort-wildcard-in-makefile' into maint-1.7.8
[git.git] / t / t5000-tar-tree.sh
index d9068981f8475c37d30e584bc6b795075a2f3063..c05c676ca206c88bf77941d76b0bb717b374c9f8 100755 (executable)
@@ -242,6 +242,14 @@ test_expect_success \
     'git archive --list outside of a git repo' \
     'GIT_DIR=some/non-existing/directory git archive --list'
 
+test_expect_success 'clients cannot access unreachable commits' '
+       test_commit unreachable &&
+       sha1=`git rev-parse HEAD` &&
+       git reset --hard HEAD^ &&
+       git archive $sha1 >remote.tar &&
+       test_must_fail git archive --remote=. $sha1 >remote.tar
+'
+
 test_expect_success 'git-archive --prefix=olde-' '
        git archive --prefix=olde- >h.tar HEAD &&
        (