diff options
author | Junio C Hamano <junkio@cox.net> | 2007-02-07 23:41:43 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-02-07 23:41:43 -0800 |
commit | d48744d1a80031003f9354a79131fca6bff6fa73 (patch) | |
tree | 8bb3690df02cb3fc2e6cf3fe7442e93fb249d364 /refs.c | |
parent | 5c553ea2de0e21cb843eaf49b1820f9e395c76a3 (diff) | |
download | git-d48744d1a80031003f9354a79131fca6bff6fa73.tar.gz |
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>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); |