diff --git a/sha1_file.c b/sha1_file.c
index 642f00d3d47c3d782c3dfe522d21819c1a67de30..82a01887c261676eb39fe72b108bfa56041d71f5 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
int safe_create_leading_directories(char *path)
{
char *pos = path;
int safe_create_leading_directories(char *path)
{
char *pos = path;
+ if (*pos == '/')
+ pos++;
while (pos) {
pos = strchr(pos, '/');
while (pos) {
pos = strchr(pos, '/');
struct packed_git *p;
unsigned long idx_size;
void *idx_map;
struct packed_git *p;
unsigned long idx_size;
void *idx_map;
+ unsigned char sha1[20];
if (check_packed_git_idx(path, &idx_size, &idx_map))
return NULL;
if (check_packed_git_idx(path, &idx_size, &idx_map))
return NULL;
p->pack_last_used = 0;
p->pack_use_cnt = 0;
p->pack_local = local;
p->pack_last_used = 0;
p->pack_use_cnt = 0;
p->pack_local = local;
+ if (!get_sha1_hex(path + path_len - 40 - 4, sha1))
+ memcpy(p->sha1, sha1, 20);
return p;
}
return p;
}