Commit 93dc164
fetch set_head: fix non-mirror remotes in bare repositories
In b1b713f (fetch set_head: handle mirrored bare repositories,
2024-11-22) it was implicitly assumed that all remotes will be mirrors
in a bare repository, thus fetching a non-mirrored remote could lead to
HEAD pointing to a non-existent reference. Make sure we only overwrite
HEAD if we are in a bare repository and fetching from a mirror.
Otherwise, proceed as normally, and create
refs/remotes/<nonmirrorremote>/HEAD instead.
Reported-by: Christian Hesse <[email protected]>
Signed-off-by: Bence Ferdinandy <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 638060d commit 93dc164
3 files changed
+32
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1619 | 1619 | | |
1620 | 1620 | | |
1621 | 1621 | | |
1622 | | - | |
| 1622 | + | |
1623 | 1623 | | |
1624 | 1624 | | |
1625 | 1625 | | |
| |||
1655 | 1655 | | |
1656 | 1656 | | |
1657 | 1657 | | |
1658 | | - | |
1659 | | - | |
1660 | | - | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
1661 | 1661 | | |
1662 | 1662 | | |
1663 | 1663 | | |
1664 | 1664 | | |
1665 | 1665 | | |
1666 | 1666 | | |
1667 | 1667 | | |
1668 | | - | |
| 1668 | + | |
1669 | 1669 | | |
1670 | 1670 | | |
1671 | 1671 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
592 | 602 | | |
593 | 603 | | |
594 | 604 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
87 | 104 | | |
88 | 105 | | |
89 | 106 | | |
| |||
0 commit comments