Commit daf7898
clone: move unborn head creation to update_head()
Prior to 4f37d45 (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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent cc8fcd1 commit daf7898
1 file changed
+15
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
| 609 | + | |
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
| |||
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
635 | 644 | | |
636 | 645 | | |
637 | 646 | | |
| |||
876 | 885 | | |
877 | 886 | | |
878 | 887 | | |
| 888 | + | |
879 | 889 | | |
880 | 890 | | |
881 | 891 | | |
| |||
1282 | 1292 | | |
1283 | 1293 | | |
1284 | 1294 | | |
1285 | | - | |
1286 | | - | |
1287 | 1295 | | |
1288 | 1296 | | |
1289 | 1297 | | |
| |||
1293 | 1301 | | |
1294 | 1302 | | |
1295 | 1303 | | |
1296 | | - | |
1297 | | - | |
| 1304 | + | |
1298 | 1305 | | |
1299 | 1306 | | |
1300 | | - | |
1301 | | - | |
| 1307 | + | |
1302 | 1308 | | |
1303 | 1309 | | |
1304 | 1310 | | |
| |||
1313 | 1319 | | |
1314 | 1320 | | |
1315 | 1321 | | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
1319 | | - | |
1320 | 1322 | | |
1321 | 1323 | | |
1322 | 1324 | | |
| |||
1336 | 1338 | | |
1337 | 1339 | | |
1338 | 1340 | | |
1339 | | - | |
| 1341 | + | |
1340 | 1342 | | |
1341 | 1343 | | |
1342 | 1344 | | |
| |||
1363 | 1365 | | |
1364 | 1366 | | |
1365 | 1367 | | |
| 1368 | + | |
1366 | 1369 | | |
1367 | 1370 | | |
1368 | 1371 | | |
| |||
0 commit comments