summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5850cb6)
raw | patch | inline | side by side (parent: 5850cb6)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Thu, 5 Apr 2007 20:55:43 +0000 (22:55 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 5 Apr 2007 21:10:10 +0000 (14:10 -0700) |
Commit 64edf4b2 cleaned up the initialization of git-archive,
at the cost of 'git-archive --list' now requiring a git repo.
This patch reverts the cleanup and documents the requirement
for this particular dirtyness in a test.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
at the cost of 'git-archive --list' now requiring a git repo.
This patch reverts the cleanup and documents the requirement
for this particular dirtyness in a test.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-archive.c | patch | blob | history | |
git.c | patch | blob | history | |
t/t5000-tar-tree.sh | patch | blob | history |
diff --git a/builtin-archive.c b/builtin-archive.c
index 2fae885f5c27f73820824b612d41fd37ab91239d..8ea6cb1efc4f988fb09051852f9e51fc88b5efd7 100644 (file)
--- a/builtin-archive.c
+++ b/builtin-archive.c
memset(&ar, 0, sizeof(ar));
tree_idx = parse_archive_args(argc, argv, &ar);
+ if (prefix == NULL)
+ prefix = setup_git_directory();
argv += tree_idx;
parse_treeish_arg(argv, &ar.args, prefix);
index 5b1bc2a895306157649e399d5bad9bb827935318..33dd4d39d907a229679a41f9712ee99007a34f3b 100644 (file)
--- a/git.c
+++ b/git.c
{ "add", cmd_add, RUN_SETUP | NOT_BARE },
{ "annotate", cmd_annotate, USE_PAGER },
{ "apply", cmd_apply },
- { "archive", cmd_archive, RUN_SETUP },
+ { "archive", cmd_archive },
{ "blame", cmd_blame, RUN_SETUP },
{ "branch", cmd_branch, RUN_SETUP },
{ "bundle", cmd_bundle },
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index ac835fe4317b7a37d77205487066d8f10bd71422..b4359df795483691e61452366add69a212347723 100755 (executable)
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
'validate file contents with prefix' \
'diff -r a e/prefix/a'
+test_expect_success \
+ 'git-archive --list outside of a git repo' \
+ 'GIT_DIR=some/non-existing/directory git-archive --list'
+
test_done