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 <junkio@cox.net>
Junio C Hamano committed
Feb 7, 2007 at 23:41 UTC
d48744d1a80031003f9354a79131fca6bff6fa73
1 file changed
+3
refs.c
+3
@@ -1000,6 +1000,9 @@ int create_symref(const char *ref_target, const char *refs_heads_master,
1000
if (logmsg && read_ref(ref_target, old_sha1))
1001
hashclr(old_sha1);
1002
1003
+ if (safe_create_leading_directories(git_HEAD) < 0)
1004
+ return error("unable to create directory for %s", git_HEAD);
1005
+
1006
#ifndef NO_SYMLINK_HEAD
1007
if (prefer_symlink_refs) {
1008
unlink(git_HEAD);