summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder@ira.uka.de>2008-03-25 21:06:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-03-26 22:41:35 (GMT)
commitaf05d67939f306a68c5f81ed30f65a82ae025661 (patch)
tree604f2ab856a425e84f67a5a65c7ee58f74e1d4c8 /setup.c
parent660b9c3a4e24ce9a2628f2ec88902e2384d1aade (diff)
downloadgit-af05d67939f306a68c5f81ed30f65a82ae025661.zip
git-af05d67939f306a68c5f81ed30f65a82ae025661.tar.gz
git-af05d67939f306a68c5f81ed30f65a82ae025661.tar.bz2
Always set *nongit_ok in setup_git_directory_gently()
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>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/setup.c b/setup.c
index 41e298b..3d2d958 100644
--- a/setup.c
+++ b/setup.c
@@ -326,6 +326,14 @@ const char *setup_git_directory_gently(int *nongit_ok)
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
* validation.