diff options
author | Jeff King <peff@peff.net> | 2022-07-11 05:21:52 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-07-11 13:32:37 -0700 |
commit | daf7898abbadef81b120f455323066158514d61b (patch) | |
tree | 2b2678edf7ffcf8916b1d87798c7012335712c59 /commit.c | |
parent | cc8fcd1e1ac6ae2a7463b295ccb48e18c73f924a (diff) |
clone: move unborn head creation to update_head()
Prior to 4f37d45706 (clone: respect remote unborn HEAD, 2021-02-05),
creation of the local HEAD was always done in update_head(). That commit
added code to handle an unborn head in an empty repository, and just did
all symref creation and config setup there.
This makes the code flow a little bit confusing, especially as new
corner cases have been covered (like the previous commit to match our
default branch name to a non-HEAD remote branch).
Let's move the creation of the unborn symref into update_head(). This
matches the other HEAD-creation cases, and now the logic is consistently
separated: the main cmd_clone() function only examines the situation and
sets variables based on what it finds, and update_head() actually
performs the update.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions