Commit d842cd1
refs: atomically record overwritten ref in update_symref
When updating a symref with update_symref it's currently not possible to
know for sure what was the previous value that was overwritten. Extend
refs_update_symref under a new function name, to record the value after
the ref has been locked if the caller of refs_update_symref_extended
requests it via a new variable in the function call. Make the return
value of the function notify the caller, if the previous value was
actually not a symbolic reference. Keep the original refs_update_symref
function with the same signature, but now as a wrapper around
refs_update_symref_extended.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 8102d10 commit d842cd1
2 files changed
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2115 | 2115 | | |
2116 | 2116 | | |
2117 | 2117 | | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
2118 | 2125 | | |
2119 | 2126 | | |
2120 | 2127 | | |
| |||
2125 | 2132 | | |
2126 | 2133 | | |
2127 | 2134 | | |
2128 | | - | |
| 2135 | + | |
2129 | 2136 | | |
| 2137 | + | |
2130 | 2138 | | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
2131 | 2149 | | |
| 2150 | + | |
2132 | 2151 | | |
2133 | 2152 | | |
2134 | 2153 | | |
| |||
2948 | 2967 | | |
2949 | 2968 | | |
2950 | 2969 | | |
2951 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
584 | 584 | | |
585 | 585 | | |
586 | 586 | | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
587 | 591 | | |
588 | 592 | | |
589 | 593 | | |
| |||
0 commit comments