From 29f3b3de99a9dc08b6ef6946cafaa559a7b4f725 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 2 Aug 2005 18:27:57 -0700 Subject: [PATCH] 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 --- receive-pack.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/receive-pack.c b/receive-pack.c index 8d6faaaa..9026f1bf 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)", -- 2.11.0