diff options
| author | Karthik Nayak <karthik.188@gmail.com> | 2025-06-20 09:15:45 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-06-25 08:20:27 -0700 |
| commit | 5c697f0b7ddbc85965bcba00c29d4b823bd221b7 (patch) | |
| tree | 05d1fa238b4ce9fd3e67bcbde2afb49801aa5b4f /refs/files-backend.c | |
| parent | refs/files: skip updates with errors in batched updates (diff) | |
| download | git-5c697f0b7ddbc85965bcba00c29d4b823bd221b7.tar.gz git-5c697f0b7ddbc85965bcba00c29d4b823bd221b7.zip | |
receive-pack: handle reference deletions separately
In 9d2962a7c4 (receive-pack: use batched reference updates, 2025-05-19)
we updated the 'git-receive-pack(1)' command to use batched reference
updates. One edge case which was missed during this implementation was
when a user pushes multiple branches such as:
delete refs/heads/branch/conflict
create refs/heads/branch
Before using batched updates, the references would be applied
sequentially and hence no conflicts would arise. With batched updates,
while the first update applies, the second fails due to D/F conflict. A
similar issue was present in 'git-fetch(1)' and was fixed by separating
out reference pruning into a separate transaction in the commit 'fetch:
use batched reference updates'. Apply a similar mechanism for
'git-receive-pack(1)' and separate out reference deletions into its own
batch.
This means 'git-receive-pack(1)' will now use up to two transactions,
whereas before using batched updates it would use _at least_ two
transactions. So using batched updates is still the better option.
Add a test to validate this behavior.
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/files-backend.c')
0 files changed, 0 insertions, 0 deletions
