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 <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2016-11-22 13:37:04 -08:00
parent 3f0ec0687d
commit eb0224c617
6 changed files with 40 additions and 15 deletions

View File

@ -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)))