Add calls to git_extract_argv0_path() in programs that call git_config_*
Programs that use git_config need to find the global configuration. When runtime prefix computation is enabled, this requires that git_extract_argv0_path() is called early in the program's main(). This commit adds the necessary calls. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
2cd72b0b29
commit
2fb3f6db96
@ -8,6 +8,7 @@
|
||||
#include "blob.h"
|
||||
#include "quote.h"
|
||||
#include "parse-options.h"
|
||||
#include "exec_cmd.h"
|
||||
|
||||
static void hash_fd(int fd, const char *type, int write_object, const char *path)
|
||||
{
|
||||
@ -81,6 +82,8 @@ int main(int argc, const char **argv)
|
||||
|
||||
type = blob_type;
|
||||
|
||||
git_extract_argv0_path(argv[0]);
|
||||
|
||||
git_config(git_default_config, NULL);
|
||||
|
||||
argc = parse_options(argc, argv, hash_object_options, hash_object_usage, 0);
|
||||
|
Reference in New Issue
Block a user