@matheusbsbs / matheus-bagliano / commits / 67ffdf4c0a
Fork 0

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>

Johannes Schindelin committed Nov 7, 2005 at 00:36 UTC 67ffdf4c0af47679b8a4ac2b70e722e2f65fc4f9
1 file changed +2
sha1_file.c
+2
@@ -51,6 +51,8 @@ int get_sha1_hex(const char *hex, unsigned char *sha1)
51 int safe_create_leading_directories(char *path)
52 {
53 char *pos = path;
54 + if (*pos == '/')
55 + pos++;
56
57 while (pos) {
58 pos = strchr(pos, '/');