To notate a branch or tag that's (subsequently) been deleted, I think it might be a good idea to fill {versioncontrol_git_event_data}.label_id with -1 instead of 0 to delineate between the db default value (which could happen if somehow we forget to try to sync that ref update with a real label) and something that indicates we *know* the branch to be deleted.

Also, lemme quickly note an edge case - it's quite possible that someone creates a branch, pushes to it for a while, deletes it, then creates another branch with the same name later. Under ordinary circumstances this wouldn't cause confusion, but IF the repo is flushed (#1244106: Implement support for event data resynchronization after a repo flush) then we'd have to be careful to note which ref updates are stored -1 and which are stored with a real label_id, otherwise it'll be impossible to tell the difference (since VersioncontrolGitRefChange::syncLabel() has to try to discover the associated ref by comparing {versioncontrol_git_event_data}.refname against {versioncontrol_labels}.name).

Comments

sdboyer’s picture

Issue tags: +vc-next

nice-to-have, but not strictly necessary.