X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=sha1_file.c;h=b4ff233bad3c15692610f93549b25cd0cf042392;hb=1a82e79315ed633f6b0b1fc4076054950c5380d3;hp=696e53f1c0c9042e925a4d64500ae43a0ffd6539;hpb=637cdd9d1d997fca34a1fc668fed1311e30fe95f;p=git.git diff --git a/sha1_file.c b/sha1_file.c index 696e53f1..b4ff233b 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -50,29 +50,6 @@ int get_sha1_hex(const char *hex, unsigned char *sha1) return 0; } -int adjust_shared_perm(const char *path) -{ - struct stat st; - int mode; - - if (!shared_repository) - return 0; - if (lstat(path, &st) < 0) - return -1; - mode = st.st_mode; - if (mode & S_IRUSR) - mode |= S_IRGRP; - if (mode & S_IWUSR) - mode |= S_IWGRP; - if (mode & S_IXUSR) - mode |= S_IXGRP; - if (S_ISDIR(mode)) - mode |= S_ISGID; - if (chmod(path, mode) < 0) - return -2; - return 0; -} - int safe_create_leading_directories(char *path) { char *pos = path; @@ -617,6 +594,12 @@ static void prepare_packed_git_one(char *objdir, int local) /* we have .idx. Is it a file we can map? */ strcpy(path + len, de->d_name); + for (p = packed_git; p; p = p->next) { + if (!memcmp(path, p->pack_name, len + namelen - 4)) + break; + } + if (p) + continue; p = add_packed_git(path, len + namelen, local); if (!p) continue;