Bug 581641 - Changes to packed-refs from other actors may be lost when writing new updates to packed-refs directly
Summary: Changes to packed-refs from other actors may be lost when writing new updates...
Status: NEW
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-07 15:06 EST by Kaushik Lingarkar CLA
Modified: 2023-03-30 17:11 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kaushik Lingarkar CLA 2023-03-07 15:06:25 EST
Setup:

1. Create a bare repository with a branch named 'to_be_removed'
2. Pack all refs in the repository
3. Ensure packed-refs contains 'to_be_removed'

Steps to reproduce:
1. Use PackedBatchRefUpdate to write a new branch named 'new' to packed-refs directly
2. Use an IDE debugger and stop the execution at step where applyUpdates() is called in PackedBatchRefUpdate.execute().
3. Delete 'to_be_removed' from packed-refs using a cmd like 'git update-ref -d to_be_removed'. Ensure that packed-refs does not contain it.
4. Resume the debugger and let it finish writing the 'new' ref
5. The updated packed-refs with 'new' ref, now erroneously also contains 'to_be_removed', despite it being deleted in [3].