summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 660b9c3)
raw | patch | inline | side by side (parent: 660b9c3)
author | SZEDER Gábor <szeder@ira.uka.de> | |
Tue, 25 Mar 2008 21:06:26 +0000 (22:06 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 26 Mar 2008 22:41:35 +0000 (15:41 -0700) |
setup_git_directory_gently() only modified the value of its *nongit_ok
argument if we were not in a git repository. Now it will always set it
to 0 when we are inside a repository.
Also remove now unnecessary initializations in the callers of this
function.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
argument if we were not in a git repository. Now it will always set it
to 0 when we are inside a repository.
Also remove now unnecessary initializations in the callers of this
function.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-apply.c | patch | blob | history | |
builtin-bundle.c | patch | blob | history | |
builtin-config.c | patch | blob | history | |
builtin-diff-files.c | patch | blob | history | |
builtin-diff.c | patch | blob | history | |
builtin-ls-remote.c | patch | blob | history | |
git.c | patch | blob | history | |
setup.c | patch | blob | history |
diff --git a/builtin-apply.c b/builtin-apply.c
index a3f075df4bd91de8d3423420cfcffd9722ad9586..b5f78ac3a78679fdb747380305fb6772c39874e0 100644 (file)
--- a/builtin-apply.c
+++ b/builtin-apply.c
int read_stdin = 1;
int inaccurate_eof = 0;
int errs = 0;
- int is_not_gitdir = 0;
+ int is_not_gitdir;
const char *whitespace_option = NULL;
diff --git a/builtin-bundle.c b/builtin-bundle.c
index 9f38e2176a4c05fe9f6f8efcabb9b1e7204fdb85..ac476e7a4b45fc55b6b6d1e4d02be0c35aba2c7b 100644 (file)
--- a/builtin-bundle.c
+++ b/builtin-bundle.c
int cmd_bundle(int argc, const char **argv, const char *prefix)
{
struct bundle_header header;
- int nongit = 0;
+ int nongit;
const char *cmd, *bundle_file;
int bundle_fd = -1;
char buffer[PATH_MAX];
diff --git a/builtin-config.c b/builtin-config.c
index 2b9a4261d4e98281855ce856041eb730565a4869..c34bc8b6a6957ccee1db23a3c44c99e058384689 100644 (file)
--- a/builtin-config.c
+++ b/builtin-config.c
int cmd_config(int argc, const char **argv, const char *prefix)
{
- int nongit = 0;
+ int nongit;
char* value;
const char *file = setup_git_directory_gently(&nongit);
diff --git a/builtin-diff-files.c b/builtin-diff-files.c
index 4abe3c28fbf98542db35c13f618b7088225740e9..e2306c162a55df30042a0bf87c9a60a1e02f5396 100644 (file)
--- a/builtin-diff-files.c
+++ b/builtin-diff-files.c
int cmd_diff_files(int argc, const char **argv, const char *prefix)
{
struct rev_info rev;
- int nongit = 0;
+ int nongit;
int result;
prefix = setup_git_directory_gently(&nongit);
diff --git a/builtin-diff.c b/builtin-diff.c
index 444ff2fd92da38ab4002af6a1882839c1c3d930a..7c2a8412fa8cefa2f53a5f7c2035ea9f2536e1c4 100644 (file)
--- a/builtin-diff.c
+++ b/builtin-diff.c
int ents = 0, blobs = 0, paths = 0;
const char *path = NULL;
struct blobinfo blob[2];
- int nongit = 0;
+ int nongit;
int result = 0;
/*
diff --git a/builtin-ls-remote.c b/builtin-ls-remote.c
index 8907a89d6c3914f4652ef387776f581015778396..06ab8da1fb1e5ebc5fedb82e74d7e6a7374cee0e 100644 (file)
--- a/builtin-ls-remote.c
+++ b/builtin-ls-remote.c
{
int i;
const char *dest = NULL;
- int nongit = 0;
+ int nongit;
unsigned flags = 0;
const char *uploadpack = NULL;
const char **pattern = NULL;
index 13de8018f0451c1e36d8fbc8f8c10233d2b45be9..b7729d72cf8dcec32215e968d39dcf675302e216 100644 (file)
--- a/git.c
+++ b/git.c
static int handle_alias(int *argcp, const char ***argv)
{
- int nongit = 0, envchanged = 0, ret = 0, saved_errno = errno;
+ int envchanged = 0, ret = 0, saved_errno = errno;
const char *subdir;
int count, option_count;
const char** new_argv;
const char *alias_command;
char *alias_string;
- subdir = setup_git_directory_gently(&nongit);
+ subdir = setup_git_directory_gently(NULL);
alias_command = (*argv)[0];
alias_string = alias_lookup(alias_command);
index 41e298b8f549dcce28fca335c5f5b7fe5aea27bb..3d2d9580f3283b4e4bc741d98863777510bd5173 100644 (file)
--- a/setup.c
+++ b/setup.c
const char *gitdirenv;
int len, offset;
+ /*
+ * Let's assume that we are in a git repository.
+ * If it turns out later that we are somewhere else, the value will be
+ * updated accordingly.
+ */
+ if (nongit_ok)
+ *nongit_ok = 0;
+
/*
* If GIT_DIR is set explicitly, we're not going
* to do any discovery, but we still do repository