summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 225f1d0)
raw | patch | inline | side by side (parent: 225f1d0)
author | Charles Bailey <charles@hashpling.org> | |
Sat, 25 Oct 2008 15:38:14 +0000 (11:38 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 26 Oct 2008 23:19:59 +0000 (16:19 -0700) |
This moves the call to git_config to a place where it doesn't break the
logic for using git archive in a bare repository but retains the fix to
make git archive respect core.autocrlf.
Tests are by René Scharfe.
Signed-off-by: Charles Bailey <charles@hashpling.org>
Tested-by: Deskin Miller <deskinm@umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
logic for using git archive in a bare repository but retains the fix to
make git archive respect core.autocrlf.
Tests are by René Scharfe.
Signed-off-by: Charles Bailey <charles@hashpling.org>
Tested-by: Deskin Miller <deskinm@umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
archive.c | patch | blob | history | |
builtin-archive.c | patch | blob | history | |
t/t5000-tar-tree.sh | patch | blob | history |
diff --git a/archive.c b/archive.c
index e2280df56723809c5af1d566f0721e2639fff10c..45d242b884c2796b67329aaabfea62cd1e7bbecb 100644 (file)
--- a/archive.c
+++ b/archive.c
parse_treeish_arg(argv, &args, prefix);
parse_pathspec_arg(argv + 1, &args);
+ git_config(git_default_config, NULL);
+
return ar->write_archive(&args);
}
diff --git a/builtin-archive.c b/builtin-archive.c
index 432ce2acc6bb687b35f3e9663f3058ebef2354e7..5ceec433fd590e8bf6a51700ea69c37f9af30fa7 100644 (file)
--- a/builtin-archive.c
+++ b/builtin-archive.c
{
const char *remote = NULL;
- git_config(git_default_config, NULL);
-
remote = extract_remote_arg(&argc, argv);
if (remote)
return run_remote_archiver(remote, argc, argv);
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index e395ff4e341bacea21cc5cd909304b7bb4fcb044..0f27d7304964e071bbaa682b183a307013150789 100755 (executable)
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
git update-ref HEAD $(TZ=GMT GIT_COMMITTER_DATE="2005-05-27 22:00:00" \
git commit-tree $treeid </dev/null)'
+test_expect_success \
+ 'create bare clone' \
+ 'git clone --bare . bare.git &&
+ cp .gitattributes bare.git/info/attributes'
+
test_expect_success \
'remove ignored file' \
'rm a/ignored'
'git archive vs. git tar-tree' \
'diff b.tar b2.tar'
+test_expect_success \
+ 'git archive in a bare repo' \
+ '(cd bare.git && git archive HEAD) >b3.tar'
+
+test_expect_success \
+ 'git archive vs. the same in a bare repo' \
+ 'test_cmp b.tar b3.tar'
+
test_expect_success \
'validate file modification time' \
'mkdir extract &&
'git archive --format=zip' \
'git archive --format=zip HEAD >d.zip'
+test_expect_success \
+ 'git archive --format=zip in a bare repo' \
+ '(cd bare.git && git archive --format=zip HEAD) >d1.zip'
+
+test_expect_success \
+ 'git archive --format=zip vs. the same in a bare repo' \
+ 'test_cmp d.zip d1.zip'
+
$UNZIP -v >/dev/null 2>&1
if [ $? -eq 127 ]; then
echo "Skipping ZIP tests, because unzip was not found"