From: Johannes Schindelin Date: Sun, 6 Nov 2005 23:36:15 +0000 (+0100) Subject: Allow GIT_DIR to be an absolute path X-Git-Tag: v0.99.9e^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/67ffdf4c0af47679b8a4ac2b70e722e2f65fc4f9?ds=inline;hp=--cc 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 Signed-off-by: Junio C Hamano --- 67ffdf4c0af47679b8a4ac2b70e722e2f65fc4f9 diff --git a/sha1_file.c b/sha1_file.c index 642f00d3d4..946a35346b 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, '/');