aboutsummaryrefslogtreecommitdiff
path: root/fsck-objects.c
diff options
context:
space:
mode:
Diffstat (limited to 'fsck-objects.c')
-rw-r--r--fsck-objects.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fsck-objects.c b/fsck-objects.c
index 6cb0f29be..b82685fd7 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)