From: Junio C Hamano Date: Thu, 8 Feb 2007 07:41:43 +0000 (-0800) Subject: create_symref(): create leading directories as needed. X-Git-Tag: v1.5.0~60 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d48744d1a80031003f9354a79131fca6bff6fa73;p=git.git create_symref(): create leading directories as needed. Otherwise "git remote add -t master -m master" without the initial fetch would not work. Signed-off-by: Junio C Hamano --- diff --git a/refs.c b/refs.c index 7e07fc4cb..f3579457c 100644 --- a/refs.c +++ b/refs.c @@ -1000,6 +1000,9 @@ int create_symref(const char *ref_target, const char *refs_heads_master, if (logmsg && read_ref(ref_target, old_sha1)) hashclr(old_sha1); + if (safe_create_leading_directories(git_HEAD) < 0) + return error("unable to create directory for %s", git_HEAD); + #ifndef NO_SYMLINK_HEAD if (prefer_symlink_refs) { unlink(git_HEAD);