summaryrefslogtreecommitdiff
path: root/t/t5000-tar-tree.sh
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2009-10-08 16:46:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-10-09 05:17:07 (GMT)
commitebfbdb340ad9a1b6fbaf91464f0fd86643fdcb46 (patch)
treefe43a12c16d2a81d3096eb0d8c805e9741b941b0 /t/t5000-tar-tree.sh
parent1cd749cc0722533bd1849f491ec9ab19e17232e1 (diff)
downloadgit-ebfbdb340ad9a1b6fbaf91464f0fd86643fdcb46.zip
git-ebfbdb340ad9a1b6fbaf91464f0fd86643fdcb46.tar.gz
git-ebfbdb340ad9a1b6fbaf91464f0fd86643fdcb46.tar.bz2
Git archive and trailing "/" in prefix
With --prefix=string that does not end with a slash, the top-level entries are written out with the specified prefix as expected, but no paths in the directories are added. Fix this by adding the prefix in write_archive_entry() instead of letting get_pathspec() and read_tree_recursive() pair; they are designed to only handle prefixes that are path components. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5000-tar-tree.sh')
-rwxr-xr-xt/t5000-tar-tree.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 5f84b18..0037f63 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -230,4 +230,16 @@ test_expect_success \
'git archive --list outside of a git repo' \
'GIT_DIR=some/non-existing/directory git archive --list'
+test_expect_success 'git-archive --prefix=olde-' '
+ git archive --prefix=olde- >h.tar HEAD &&
+ (
+ mkdir h &&
+ cd h &&
+ "$TAR" xf - <../h.tar
+ ) &&
+ test -d h/olde-a &&
+ test -d h/olde-a/bin &&
+ test -f h/olde-a/bin/sh
+'
+
test_done