git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Fixed git archive for bare repos

From
Charles Bailey <charles@hashpling.org>
Date
Oct 22, 2008, 21:47 UTC
Message-ID
<1224712023-5280-1-git-send-email-charles@hashpling.org>
In-Reply-To
<20081022210913.GB22541@hashpling.org>

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.

Signed-off-by: Charles Bailey <charles@hashpling.org>
---

OK, I've had a chance to have a quick look at this issue and I have an altenative patch.

This is an alternative fix to the current git archive in a bare repository issue.

It's been lightly tested and doesn't re-break the zip / autocrlf issue that the previous introduction of git_config was designed to fix.

 archive.c         |    2 ++
 builtin-archive.c |    2 --
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/archive.c b/archive.c
index 849eed5..9ac455d 100644
--- a/archive.c
+++ b/archive.c
@@ -336,5 +336,7 @@ int write_archive(int argc, const char **argv, const char *prefix,
 	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 432ce2a..5ceec43 100644
--- a/builtin-archive.c
+++ b/builtin-archive.c
@@ -111,8 +111,6 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
 {
 	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);
-- 
1.6.0.2.534.g5ab59
Previous: Charles BaileyNext: Deskin Miller
Message 7 of 14 in “git archive”
  1. kenneth johanssonOct 22, 2008
  2. Deskin MillerOct 22, 2008
  3. kenneth johanssonOct 22, 2008
  4. archive: fix setup to work in bare repositoriesDeskin Miller, Oct 22, 2008
  5. Jeff KingOct 22, 2008
  6. Charles BaileyOct 22, 2008
  7. Fixed git archive for bare reposCharles Bailey, Oct 22, 2008
  8. Deskin MillerOct 23, 2008
  9. René ScharfeOct 24, 2008
  10. Fixed git archive for bare reposDeskin Miller, Oct 25, 2008
  11. Junio C HamanoOct 25, 2008
  12. Nguyen Thai Ngoc DuyOct 23, 2008
  13. Deskin MillerOct 23, 2008
  14. Nguyen Thai Ngoc DuyOct 24, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.