aboutsummaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2005-11-07 00:36:15 +0100
committerJunio C Hamano <junkio@cox.net>2005-11-06 18:31:46 -0800
commit67ffdf4c0af47679b8a4ac2b70e722e2f65fc4f9 (patch)
tree3ae96fe4b4024014e6c97147f7c112c24c6e2582 /sha1_file.c
parentbee8e79da08f3e50fd7e3b3b203aea284a933fe1 (diff)
downloadgit-67ffdf4c0af47679b8a4ac2b70e722e2f65fc4f9.tar.gz
git-67ffdf4c0af47679b8a4ac2b70e722e2f65fc4f9.tar.xz
Allow GIT_DIR to be an absolute path
This fixes a problem in safe_create_leading_directories() when the argument starts with a '/' (i.e. the path is absolute). Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 642f00d3d..946a35346 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -51,6 +51,8 @@ int get_sha1_hex(const char *hex, unsigned char *sha1)
int safe_create_leading_directories(char *path)
{
char *pos = path;
+ if (*pos == '/')
+ pos++;
while (pos) {
pos = strchr(pos, '/');