aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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, '/');