summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2cd72b0)
raw | patch | inline | side by side (parent: 2cd72b0)
author | Steffen Prohaska <prohaska@zib.de> | |
Sun, 18 Jan 2009 12:00:12 +0000 (13:00 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 26 Jan 2009 08:26:05 +0000 (00:26 -0800) |
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>
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>
16 files changed:
daemon.c | patch | blob | history | |
fast-import.c | patch | blob | history | |
hash-object.c | patch | blob | history | |
http-push.c | patch | blob | history | |
imap-send.c | patch | blob | history | |
index-pack.c | patch | blob | history | |
merge-index.c | patch | blob | history | |
merge-tree.c | patch | blob | history | |
mktag.c | patch | blob | history | |
mktree.c | patch | blob | history | |
pack-redundant.c | patch | blob | history | |
patch-id.c | patch | blob | history | |
unpack-file.c | patch | blob | history | |
update-server-info.c | patch | blob | history | |
upload-pack.c | patch | blob | history | |
var.c | patch | blob | history |
diff --git a/daemon.c b/daemon.c
index 540700ee844eb47c417c10a04a85af9af5b23569..d93cf960f9eaf05eec11b67746142e6e94d719cb 100644 (file)
--- a/daemon.c
+++ b/daemon.c
gid_t gid = 0;
int i;
+ git_extract_argv0_path(argv[0]);
+
for (i = 1; i < argc; i++) {
char *arg = argv[i];
diff --git a/fast-import.c b/fast-import.c
index f0e08aca70c16e9309dde87954593a76ad37b9ef..1935206be04f3ecc52512958879734b0895d1953 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
#include "refs.h"
#include "csum-file.h"
#include "quote.h"
+#include "exec_cmd.h"
#define PACK_ID_BITS 16
#define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
{
unsigned int i, show_stats = 1;
+ git_extract_argv0_path(argv[0]);
+
setup_git_directory();
git_config(git_pack_config, NULL);
if (!pack_compression_seen && core_compression_seen)
diff --git a/hash-object.c b/hash-object.c
index 846e91a23126b747fbea8d9a8511f708c3d70e43..37e66779ab9e14dbe5b5416d0e19b04d7f122d52 100644 (file)
--- a/hash-object.c
+++ b/hash-object.c
#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)
{
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);
diff --git a/http-push.c b/http-push.c
index 6ad853e2d01b4ee3b3ee282b30b8b7f374ae3d47..a99fdfc0efe7a12d4f1c7442b483c880c662b5b7 100644 (file)
--- a/http-push.c
+++ b/http-push.c
struct ref *ref;
char *rewritten_url = NULL;
+ git_extract_argv0_path(argv[0]);
+
setup_git_directory();
remote = xcalloc(sizeof(*remote), 1);
diff --git a/imap-send.c b/imap-send.c
index c3fa0df855395f08a53c8619af50d28a478bbb3d..f91293c23f2bcb6d673e0316cd3736fdddd0fbe4 100644 (file)
--- a/imap-send.c
+++ b/imap-send.c
*/
#include "cache.h"
+#include "exec_cmd.h"
#ifdef NO_OPENSSL
typedef void *SSL;
#endif
int total, n = 0;
int nongit_ok;
+ git_extract_argv0_path(argv[0]);
+
/* init the random number generator */
arc4_init();
diff --git a/index-pack.c b/index-pack.c
index 2931511e8cd9f2a825d1eb949858ea9b305c337f..72c41fd4f7b8c50f2b84f6125a81e1608533339c 100644 (file)
--- a/index-pack.c
+++ b/index-pack.c
#include "tree.h"
#include "progress.h"
#include "fsck.h"
+#include "exec_cmd.h"
static const char index_pack_usage[] =
"git index-pack [-v] [-o <index-file>] [{ ---keep | --keep=<msg> }] [--strict] { <pack-file> | --stdin [--fix-thin] [<pack-file>] }";
struct pack_idx_entry **idx_objects;
unsigned char pack_sha1[20];
+ git_extract_argv0_path(argv[0]);
+
/*
* We wish to read the repository's config file if any, and
* for that it is necessary to call setup_git_directory_gently().
diff --git a/merge-index.c b/merge-index.c
index 7827e87a928586226570132fc8922991b1cb6c8a..c00a2b385a3373f88b9fd3f087d9681cdc46cbf6 100644 (file)
--- a/merge-index.c
+++ b/merge-index.c
#include "cache.h"
#include "run-command.h"
+#include "exec_cmd.h"
static const char *pgm;
static const char *arguments[9];
if (argc < 3)
usage("git-merge-index [-o] [-q] <merge-program> (-a | [--] <filename>*)");
+ git_extract_argv0_path(argv[0]);
+
setup_git_directory();
read_cache();
diff --git a/merge-tree.c b/merge-tree.c
index 2d1413efbbc33c51fd4820933dcb54164e12d706..f18201acdb21f7eb3e09a546382417851b572fd4 100644 (file)
--- a/merge-tree.c
+++ b/merge-tree.c
#include "tree-walk.h"
#include "xdiff-interface.h"
#include "blob.h"
+#include "exec_cmd.h"
static const char merge_tree_usage[] = "git-merge-tree <base-tree> <branch1> <branch2>";
static int resolve_directories = 1;
if (argc != 4)
usage(merge_tree_usage);
+ git_extract_argv0_path(argv[0]);
+
setup_git_directory();
buf1 = get_tree_descriptor(t+0, argv[1]);
index ba3d495e0715d83ffab3103e4d340a3b9ac4f4e7..6d5083eaf04b9ad1b54dad5eaca33d9a73373bbd 100644 (file)
--- a/mktag.c
+++ b/mktag.c
#include "cache.h"
#include "tag.h"
+#include "exec_cmd.h"
/*
* A signature file has a very simple fixed format: four lines
if (argc != 1)
usage("git-mktag < signaturefile");
+ git_extract_argv0_path(argv[0]);
+
setup_git_directory();
if (strbuf_read(&buf, 0, 4096) < 0) {
diff --git a/mktree.c b/mktree.c
index 514fd9b15a6680389bf2c1274d29c55d2c1034f7..6283bc3d431eca77e79970d1de59c61ac36af028 100644 (file)
--- a/mktree.c
+++ b/mktree.c
#include "cache.h"
#include "quote.h"
#include "tree.h"
+#include "exec_cmd.h"
static struct treeent {
unsigned mode;
unsigned char sha1[20];
int line_termination = '\n';
+ git_extract_argv0_path(av[0]);
+
setup_git_directory();
while ((1 < ac) && av[1][0] == '-') {
diff --git a/pack-redundant.c b/pack-redundant.c
index e93eb966e2ccd4bfe31a89668d55c2276c45b87a..48a12bc1352ad53fbc19ec8c5982a91673a098e1 100644 (file)
--- a/pack-redundant.c
+++ b/pack-redundant.c
*/
#include "cache.h"
+#include "exec_cmd.h"
#define BLKSIZE 512
unsigned char *sha1;
char buf[42]; /* 40 byte sha1 + \n + \0 */
+ git_extract_argv0_path(argv[0]);
+
setup_git_directory();
for (i = 1; i < argc; i++) {
diff --git a/patch-id.c b/patch-id.c
index 871f1d20c0e364220d23035b34685ced8737cda8..3660ad461d359a7fb968692f40cea75c9764f61a 100644 (file)
--- a/patch-id.c
+++ b/patch-id.c
#include "cache.h"
+#include "exec_cmd.h"
static void flush_current_id(int patchlen, unsigned char *id, git_SHA_CTX *c)
{
if (argc != 1)
usage(patch_id_usage);
+ git_extract_argv0_path(argv[0]);
+
generate_id_list();
return 0;
}
diff --git a/unpack-file.c b/unpack-file.c
index bcdc8bbb3b44a43aa43db6035a31478158e070af..6dd8ad02fbb05ca9124473d29132d31f0e14ede0 100644 (file)
--- a/unpack-file.c
+++ b/unpack-file.c
#include "cache.h"
#include "blob.h"
+#include "exec_cmd.h"
static char *create_temp_file(unsigned char *sha1)
{
{
unsigned char sha1[20];
+ git_extract_argv0_path(argv[0]);
+
if (argc != 2)
usage("git-unpack-file <sha1>");
if (get_sha1(argv[1], sha1))
diff --git a/update-server-info.c b/update-server-info.c
index 7e8209ea4b43995737b36bc58db47e7dd6eadb19..7b38fd867bba6f8b8dcf9f2094769314b7f23e02 100644 (file)
--- a/update-server-info.c
+++ b/update-server-info.c
#include "cache.h"
+#include "exec_cmd.h"
static const char update_server_info_usage[] =
"git update-server-info [--force]";
if (i != ac)
usage(update_server_info_usage);
+ git_extract_argv0_path(av[0]);
+
setup_git_directory();
return !!update_server_info(force);
diff --git a/upload-pack.c b/upload-pack.c
index e5adbc011e0ab71eeb06a42c4bd40cbea0bf3fa2..5db6f939551dff618b9e4c7a8bbf5a51bfa3032f 100644 (file)
--- a/upload-pack.c
+++ b/upload-pack.c
int i;
int strict = 0;
+ git_extract_argv0_path(argv[0]);
+
for (i = 1; i < argc; i++) {
char *arg = argv[i];
index f1eb314e899c518b8dea54b4ff8f3923da7b12cf..7362ed87354a4bea98c28f9a8c315b7209c67fa2 100644 (file)
--- a/var.c
+++ b/var.c
* Copyright (C) Eric Biederman, 2005
*/
#include "cache.h"
+#include "exec_cmd.h"
static const char var_usage[] = "git var [-l | <variable>]";
usage(var_usage);
}
+ git_extract_argv0_path(argv[0]);
+
setup_git_directory_gently(&nongit);
val = NULL;