mirror of
https://github.com/git/git.git
synced 2024-12-01 22:13:45 +08:00
2fb3f6db96
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>
29 lines
512 B
C
29 lines
512 B
C
#include "cache.h"
|
|
#include "exec_cmd.h"
|
|
|
|
static const char update_server_info_usage[] =
|
|
"git update-server-info [--force]";
|
|
|
|
int main(int ac, char **av)
|
|
{
|
|
int i;
|
|
int force = 0;
|
|
for (i = 1; i < ac; i++) {
|
|
if (av[i][0] == '-') {
|
|
if (!strcmp("--force", av[i]) ||
|
|
!strcmp("-f", av[i]))
|
|
force = 1;
|
|
else
|
|
usage(update_server_info_usage);
|
|
}
|
|
}
|
|
if (i != ac)
|
|
usage(update_server_info_usage);
|
|
|
|
git_extract_argv0_path(av[0]);
|
|
|
|
setup_git_directory();
|
|
|
|
return !!update_server_info(force);
|
|
}
|