mirror of
https://github.com/git/git.git
synced 2024-11-23 18:05:29 +08:00
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>
This commit is contained in:
parent
5c553ea2de
commit
d48744d1a8
3
refs.c
3
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);
|
||||
|
Loading…
Reference in New Issue
Block a user