path: root/builtin
diff options
authorJunio C Hamano <>2016-11-22 21:37:04 (GMT)
committerJunio C Hamano <>2016-11-22 21:55:20 (GMT)
commiteb0224c617ba6b4299f2a9f85d6c4b3b5e10abc0 (patch)
treee619ede7551b1afd632defa778924abafabc87d4 /builtin
parent3f0ec0687d95e0f53c899f964d769ca1846874da (diff)
archive: read local configuration
Since b9605bc4f2 ("config: only read .git/config from configured repos", 2016-09-12), we do not read from ".git/config" unless we know we are in a repository. "git archive" however didn't do the repository discovery and instead relied on the old behaviour. Teach the command to run a "gentle" version of repository discovery so that local configuration variables are honoured. [jc: stole tests from peff] Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin')
2 files changed, 4 insertions, 4 deletions
diff --git a/builtin/archive.c b/builtin/archive.c
index 49f4914..f863465 100644
--- a/builtin/archive.c
+++ b/builtin/archive.c
@@ -85,8 +85,8 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
const char *output = NULL;
const char *remote = NULL;
struct option local_opts[] = {
- OPT_STRING('o', "output", &output, N_("file"),
- N_("write the archive to this file")),
+ OPT_FILENAME('o', "output", &output,
+ N_("write the archive to this file")),
OPT_STRING(0, "remote", &remote, N_("repo"),
N_("retrieve the archive from remote repository <repo>")),
OPT_STRING(0, "exec", &exec, N_("command"),
@@ -105,5 +105,5 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
setvbuf(stderr, NULL, _IOLBF, BUFSIZ);
- return write_archive(argc, argv, prefix, 1, output, 0);
+ return write_archive(argc, argv, prefix, output, 0);
diff --git a/builtin/upload-archive.c b/builtin/upload-archive.c
index dc872f6..cde0697 100644
--- a/builtin/upload-archive.c
+++ b/builtin/upload-archive.c
@@ -43,7 +43,7 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)
/* parse all options sent by the client */
- return write_archive(sent_argv.argc, sent_argv.argv, prefix, 0, NULL, 1);
+ return write_archive(sent_argv.argc, sent_argv.argv, prefix, NULL, 1);
__attribute__((format (printf, 1, 2)))