From 5da1606d0bf5b970fadfa0ca91618a1e871f6755 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 26 Sep 2005 22:54:01 +0200 Subject: [PATCH] Provide access to git_dir through get_git_dir(). Signed-off-by: Sven Verdoolaege Signed-off-by: Junio C Hamano --- fsck-objects.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'fsck-objects.c') diff --git a/fsck-objects.c b/fsck-objects.c index 6cb0f29be8..b82685fd71 100644 --- a/fsck-objects.c +++ b/fsck-objects.c @@ -406,10 +406,7 @@ static int fsck_head_link(void) char hex[40]; unsigned char sha1[20]; static char path[PATH_MAX], link[PATH_MAX]; - const char *git_dir; - - git_dir = getenv(GIT_DIR_ENVIRONMENT); - if (!git_dir) git_dir = DEFAULT_GIT_DIR_ENVIRONMENT; + const char *git_dir = get_git_dir(); snprintf(path, sizeof(path), "%s/HEAD", git_dir); if (readlink(path, link, sizeof(link)) < 0) -- cgit v1.2.3