From af05d67939f306a68c5f81ed30f65a82ae025661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Tue, 25 Mar 2008 22:06:26 +0100 Subject: Always set *nongit_ok in setup_git_directory_gently() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- setup.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'setup.c') diff --git a/setup.c b/setup.c index 41e298b8f5..3d2d9580f3 100644 --- a/setup.c +++ b/setup.c @@ -325,6 +325,14 @@ const char *setup_git_directory_gently(int *nongit_ok) 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 -- cgit v1.2.1