projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] git-clone-script: store where we cloned from in .git/branches/origin
[git.git]
/
receive-pack.c
diff --git
a/receive-pack.c
b/receive-pack.c
index
dfa7cd1
..
f39703f
100644
(file)
--- 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);
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, 06
44
);
+ newfd = open(lock_name, O_CREAT | O_EXCL | O_WRONLY, 06
66
);
if (newfd < 0)
die("unable to create %s (%s)", lock_name, strerror(errno));
if (newfd < 0)
die("unable to create %s (%s)", lock_name, strerror(errno));
@@
-197,9
+197,7
@@
int main(int argc, char **argv)
/* chdir to the directory. If that fails, try appending ".git" */
if (chdir(dir) < 0) {
/* 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);
}
die("unable to cd to %s", dir);
}