Merge branch 'js/fsck-tag-validation'
[gitweb.git] / t / t5000-tar-tree.sh
index 7b8babd89b22dc94d3a3f839d72cce86c5aaea59..4b68bbafbe9016d66ce4f96f2058ac67640ed147 100755 (executable)
@@ -101,7 +101,7 @@ test_expect_success \
      ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&
      echo long filename >a/four$hundred &&
      mkdir a/bin &&
-     cp /bin/sh a/bin &&
+     test-genrandom "frotz" 500000 >a/bin/sh &&
      printf "A\$Format:%s\$O" "$SUBSTFORMAT" >a/substfile1 &&
      printf "A not substituted O" >a/substfile2 &&
      if test_have_prereq SYMLINKS; then
@@ -305,4 +305,18 @@ test_expect_success GZIP 'remote tar.gz can be disabled' '
                >remote.tar.gz
 '
 
+test_expect_success 'archive and :(glob)' '
+       git archive -v HEAD -- ":(glob)**/sh" >/dev/null 2>actual &&
+       cat >expect <<EOF &&
+a/
+a/bin/
+a/bin/sh
+EOF
+       test_cmp expect actual
+'
+
+test_expect_success 'catch non-matching pathspec' '
+       test_must_fail git archive -v HEAD -- "*.abc" >/dev/null
+'
+
 test_done