X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=sha1_file.c;h=946a35346bdaf21432b7f463712f5bf8881fee39;hb=93d69d86912c44206543f6670e93f9fc6f2f859f;hp=642f00d3d47c3d782c3dfe522d21819c1a67de30;hpb=1301c6eb412e7c5511b952a12e42c70ad56f028b;p=git.git diff --git a/sha1_file.c b/sha1_file.c index 642f00d3..946a3534 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, '/');