Commit a653f56
committed
rebase: guard non-branch symref targets
A local branch symbolic ref may point outside refs/heads/. Such an alias
cannot be skipped like a branch-to-branch alias because its concrete
target ref is absent from the local branch decoration list.
However, queuing each alias independently can update the same target ref
more than once and make the second compare-and-swap fail. A reservation
from another worktree can also name either an alias or its resolved
target ref, so checking only one form can miss an in-progress update.
Fix these cases by checking both the literal alias and its resolved
target ref against checked-out reservations. Deduplicate updates by
target ref. Also reserve both forms when loading another worktree's
update-refs state. This makes different aliases honor the same
in-progress update.
This keeps non-branch symrefs supported without allowing duplicate or
cross-worktree ref updates.
Signed-off-by: Son Luong Ngoc <sluongng@gmail.com>1 parent b9a01e9 commit a653f56
3 files changed
Lines changed: 106 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
445 | 448 | | |
446 | 449 | | |
447 | 450 | | |
448 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
449 | 464 | | |
450 | 465 | | |
451 | 466 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6459 | 6459 | | |
6460 | 6460 | | |
6461 | 6461 | | |
| 6462 | + | |
6462 | 6463 | | |
6463 | 6464 | | |
6464 | 6465 | | |
| |||
6473 | 6474 | | |
6474 | 6475 | | |
6475 | 6476 | | |
| 6477 | + | |
6476 | 6478 | | |
6477 | 6479 | | |
6478 | 6480 | | |
| |||
6508 | 6510 | | |
6509 | 6511 | | |
6510 | 6512 | | |
| 6513 | + | |
| 6514 | + | |
| 6515 | + | |
| 6516 | + | |
| 6517 | + | |
| 6518 | + | |
| 6519 | + | |
| 6520 | + | |
| 6521 | + | |
| 6522 | + | |
| 6523 | + | |
6511 | 6524 | | |
6512 | 6525 | | |
6513 | 6526 | | |
| |||
6523 | 6536 | | |
6524 | 6537 | | |
6525 | 6538 | | |
| 6539 | + | |
| 6540 | + | |
| 6541 | + | |
| 6542 | + | |
6526 | 6543 | | |
6527 | 6544 | | |
6528 | 6545 | | |
| |||
6554 | 6571 | | |
6555 | 6572 | | |
6556 | 6573 | | |
| 6574 | + | |
6557 | 6575 | | |
6558 | 6576 | | |
6559 | 6577 | | |
| |||
6579 | 6597 | | |
6580 | 6598 | | |
6581 | 6599 | | |
| 6600 | + | |
6582 | 6601 | | |
6583 | 6602 | | |
6584 | 6603 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2024 | 2024 | | |
2025 | 2025 | | |
2026 | 2026 | | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
2027 | 2099 | | |
2028 | 2100 | | |
2029 | 2101 | | |
| |||
0 commit comments