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>
This commit is contained in:
Johannes Schindelin 2005-11-07 00:36:15 +01:00 committed by Junio C Hamano
parent bee8e79da0
commit 67ffdf4c0a

View file

@ -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, '/');