{"thread":{"id":"7522","subject":"Minor git-archive bug","startedAt":"2007-04-05T11:27:08Z","lastAt":"2007-04-05T21:37:07Z","messageCount":3,"participants":["Jeff Garzik","René Scharfe","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"38695","messageId":"4614DD0C.50600@garzik.org","threadId":"7522","inReplyTo":null,"subject":"Minor git-archive bug","fromName":"Jeff Garzik","fromEmail":"jeff@garzik.org","sentAt":"2007-04-05T11:27:08Z","receivedAt":"2007-04-05T11:27:08Z","isPatch":false,"sender":{"key":"jeff@garzik.org","avatar":null},"body":"\"git-archive --list\" requires a git repository.  Certainly listing the \narchive formats doesn't /really/ require such things.\n\n\tJeff\n"},{"id":"38733","messageId":"4615624F.50504@lsrfire.ath.cx","threadId":"7522","inReplyTo":"4614DD0C.50600@garzik.org","subject":"[PATCH] Revert \"builtin-archive: use RUN_SETUP\"","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2007-04-05T20:55:43Z","receivedAt":"2007-04-05T20:55:43Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Commit 64edf4b2 cleaned up the initialization of git-archive,\nat the cost of 'git-archive --list' now requiring a git repo.\nThis patch reverts the cleanup and documents the requirement\nfor this particular dirtyness in a test.\n\nSigned-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>\n---\n\nJeff Garzik schrieb:\n> \"git-archive --list\" requires a git repository.  Certainly listing the\n> archive formats doesn't /really/ require such things.\n\n builtin-archive.c   |    2 ++\n git.c               |    2 +-\n t/t5000-tar-tree.sh |    4 ++++\n 3 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-archive.c b/builtin-archive.c\nindex 2fae885..8ea6cb1 100644\n--- a/builtin-archive.c\n+++ b/builtin-archive.c\n@@ -252,6 +252,8 @@ int cmd_archive(int argc, const char **argv, const char *prefix)\n \n \tmemset(&ar, 0, sizeof(ar));\n \ttree_idx = parse_archive_args(argc, argv, &ar);\n+\tif (prefix == NULL)\n+\t\tprefix = setup_git_directory();\n \n \targv += tree_idx;\n \tparse_treeish_arg(argv, &ar.args, prefix);\ndiff --git a/git.c b/git.c\nindex 5b1bc2a..33dd4d3 100644\n--- a/git.c\n+++ b/git.c\n@@ -226,7 +226,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)\n \t\t{ \"add\", cmd_add, RUN_SETUP | NOT_BARE },\n \t\t{ \"annotate\", cmd_annotate, USE_PAGER },\n \t\t{ \"apply\", cmd_apply },\n-\t\t{ \"archive\", cmd_archive, RUN_SETUP },\n+\t\t{ \"archive\", cmd_archive },\n \t\t{ \"blame\", cmd_blame, RUN_SETUP },\n \t\t{ \"branch\", cmd_branch, RUN_SETUP },\n \t\t{ \"bundle\", cmd_bundle },\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex ac835fe..b4359df 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -130,4 +130,8 @@ test_expect_success \\\n     'validate file contents with prefix' \\\n     'diff -r a e/prefix/a'\n \n+test_expect_success \\\n+    'git-archive --list outside of a git repo' \\\n+    'GIT_DIR=some/non-existing/directory git-archive --list'\n+\n test_done\n"},{"id":"38737","messageId":"7vd52io64c.fsf@assigned-by-dhcp.cox.net","threadId":"7522","inReplyTo":"4615624F.50504@lsrfire.ath.cx","subject":"Re: [PATCH] Revert \"builtin-archive: use RUN_SETUP\"","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-04-05T21:37:07Z","receivedAt":"2007-04-05T21:37:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}