Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15
DORMANTno replies

[PATCH 2/3] builtin-init-db: use get_git_dir() instead of getenv()

From: Steffen Prohaska <hidden>
Date: 2016-06-15 22:43:53
Subsystem: the rest · Maintainer: Linus Torvalds

We have a function get_git_dir().  So let's use it,
instead of querying the environment.

Signed-off-by: Steffen Prohaska <redacted>
---
 builtin-init-db.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/builtin-init-db.c b/builtin-init-db.c
index 763fa55..80d2f27 100644
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -378,9 +378,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
 	/*
 	 * Set up the default .git directory contents
 	 */
-	git_dir = getenv(GIT_DIR_ENVIRONMENT);
-	if (!git_dir)
-		git_dir = DEFAULT_GIT_DIR_ENVIRONMENT;
+	git_dir = get_git_dir();
 	safe_create_dir(git_dir, 0);
 
 	/* Check to see if the repository version is right.
-- 
1.5.3.5.750.g8692
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help