aboutsummaryrefslogtreecommitdiffstats
path: root/receive-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-08-02 18:27:57 -0700
committerJunio C Hamano <junkio@cox.net>2005-08-02 22:52:58 -0700
commit29f3b3de99a9dc08b6ef6946cafaa559a7b4f725 (patch)
treef1c181deb4afa02898ee264078521f02d69fd56d /receive-pack.c
parent19614330ddaf02367a7faf2ff5e09f1f39fd63c4 (diff)
downloadgit-29f3b3de99a9dc08b6ef6946cafaa559a7b4f725.tar.gz
Make sure leading directories exist when pushing refs.
It does not matter if the only refs you push are directly underneath heads and tags, but we forgot to make sure we have leading directories so pushing tags/v0.99/1 would not have worked. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'receive-pack.c')
-rw-r--r--receive-pack.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/receive-pack.c b/receive-pack.c
index 8d6faaaa9c..9026f1bf82 100644
--- a/receive-pack.c
+++ b/receive-pack.c
@@ -106,6 +106,8 @@ static int update(const char *name,
return error("unpack should have generated %s, "
"but I can't find it!", new_hex);
+ safe_create_leading_directories(lock_name);
+
newfd = open(lock_name, O_CREAT | O_EXCL | O_WRONLY, 0666);
if (newfd < 0)
return error("unable to create %s (%s)",