X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=receive-pack.c;h=d4e82bf99397d2e719e8bbe1e0e72142d04fb4cb;hb=4d1f11903393bd79998144ce1089ce427a49a2ed;hp=dfa7cd1d0a81eade8225e11dc0f2b97682a905c0;hpb=b43d44779bf98977b211256f936d0edda8a9625a;p=git.git diff --git a/receive-pack.c b/receive-pack.c index dfa7cd1d..d4e82bf9 100644 --- a/receive-pack.c +++ b/receive-pack.c @@ -70,7 +70,7 @@ static void update(const char *name, unsigned char *old_sha1, unsigned char *new if (!has_sha1_file(new_sha1)) die("unpack should have generated %s, but I can't find it!", new_hex); - newfd = open(lock_name, O_CREAT | O_EXCL | O_WRONLY, 0644); + newfd = open(lock_name, O_CREAT | O_EXCL | O_WRONLY, 0666); if (newfd < 0) die("unable to create %s (%s)", lock_name, strerror(errno)); @@ -110,6 +110,7 @@ static void execute_commands(void) update(cmd->ref_name, cmd->old_sha1, cmd->new_sha1); cmd = cmd->next; } + update_server_info(0); } static void read_head_info(void) @@ -197,9 +198,7 @@ int main(int argc, char **argv) /* chdir to the directory. If that fails, try appending ".git" */ if (chdir(dir) < 0) { - static char path[PATH_MAX]; - snprintf(path, sizeof(path), "%s.git", dir); - if (chdir(path) < 0) + if (chdir(mkpath("%s.git", dir)) < 0) die("unable to cd to %s", dir); }