Revert "builtin-archive: use RUN_SETUP"
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>
René Scharfe committed
Apr 5, 2007 at 22:55 UTC
265d528032e55c48798266c538d3e6338cb1e2b6
3 files changed
+7
-1
builtin-archive.c
+2
@@ -252,6 +252,8 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
252
253
memset(&ar, 0, sizeof(ar));
254
tree_idx = parse_archive_args(argc, argv, &ar);
255
+ if (prefix == NULL)
256
+ prefix = setup_git_directory();
257
258
argv += tree_idx;
259
parse_treeish_arg(argv, &ar.args, prefix);
git.c
+1
-1
@@ -226,7 +226,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
226
{ "add", cmd_add, RUN_SETUP | NOT_BARE },
227
{ "annotate", cmd_annotate, USE_PAGER },
228
{ "apply", cmd_apply },
229
- { "archive", cmd_archive, RUN_SETUP },
229
+ { "archive", cmd_archive },
230
{ "blame", cmd_blame, RUN_SETUP },
231
{ "branch", cmd_branch, RUN_SETUP },
232
{ "bundle", cmd_bundle },
t/t5000-tar-tree.sh
+4
@@ -130,4 +130,8 @@ test_expect_success \
130
'validate file contents with prefix' \
131
'diff -r a e/prefix/a'
132
133
+test_expect_success \
134
+ 'git-archive --list outside of a git repo' \
135
+ 'GIT_DIR=some/non-existing/directory git-archive --list'
136
+
137
test_done