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>
This commit is contained in:
René Scharfe 2007-04-05 22:55:43 +02:00 committed by Junio C Hamano
parent 5850cb645d
commit 265d528032
3 changed files with 7 additions and 1 deletions

View File

@ -252,6 +252,8 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
memset(&ar, 0, sizeof(ar)); memset(&ar, 0, sizeof(ar));
tree_idx = parse_archive_args(argc, argv, &ar); tree_idx = parse_archive_args(argc, argv, &ar);
if (prefix == NULL)
prefix = setup_git_directory();
argv += tree_idx; argv += tree_idx;
parse_treeish_arg(argv, &ar.args, prefix); parse_treeish_arg(argv, &ar.args, prefix);

2
git.c
View File

@ -226,7 +226,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
{ "add", cmd_add, RUN_SETUP | NOT_BARE }, { "add", cmd_add, RUN_SETUP | NOT_BARE },
{ "annotate", cmd_annotate, USE_PAGER }, { "annotate", cmd_annotate, USE_PAGER },
{ "apply", cmd_apply }, { "apply", cmd_apply },
{ "archive", cmd_archive, RUN_SETUP }, { "archive", cmd_archive },
{ "blame", cmd_blame, RUN_SETUP }, { "blame", cmd_blame, RUN_SETUP },
{ "branch", cmd_branch, RUN_SETUP }, { "branch", cmd_branch, RUN_SETUP },
{ "bundle", cmd_bundle }, { "bundle", cmd_bundle },

View File

@ -130,4 +130,8 @@ test_expect_success \
'validate file contents with prefix' \ 'validate file contents with prefix' \
'diff -r a e/prefix/a' '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 test_done