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:
Steffen Prohaska
2009-01-18 13:00:12 +01:00
committed by Junio C Hamano
parent 2cd72b0b29
commit 2fb3f6db96
16 changed files with 45 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#include "cache.h"
#include "blob.h"
#include "exec_cmd.h"
static char *create_temp_file(unsigned char *sha1)
{
@ -25,6 +26,8 @@ int main(int argc, char **argv)
{
unsigned char sha1[20];
git_extract_argv0_path(argv[0]);
if (argc != 2)
usage("git-unpack-file <sha1>");
if (get_sha1(argv[1], sha1))