Skip to content

Commit

Permalink
Allow GIT_DIR to be an absolute path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Nov 7, 2005
1 parent bee8e79 commit 67ffdf4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, '/');
Expand Down

0 comments on commit 67ffdf4

Please sign in to comment.