[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