Page MenuHomePhabricator

Respond more gracefully when a git push deletes a nonexistent ref
ClosedPublic

Authored by epriestley on Jul 2 2014, 8:38 PM.
Tags
None
Referenced Files
F15462115: D9800.diff
Tue, Apr 1, 12:50 PM
F15438629: D9800.id.diff
Wed, Mar 26, 2:07 AM
F15408261: D9800.id.diff
Tue, Mar 18, 9:59 PM
F15390194: D9800.id23704.diff
Sat, Mar 15, 5:59 AM
F15364608: D9800.id23704.diff
Tue, Mar 11, 1:43 PM
Unknown Object (File)
Feb 27 2025, 4:21 AM
Unknown Object (File)
Feb 25 2025, 5:05 PM
Unknown Object (File)
Feb 9 2025, 1:59 PM
Subscribers

Details

Summary

Fixes T5534. If you git push origin :refs/tags/doesnotexist (for some non-existing tag), we get a change where both the old and new refs are empty.

We incorrectly call this an "add", because the old ref is empty. Instead, call this a "delete", but skip the logic which would normally mark it dangerous.

(Possibly we should just reject these outright, but Git allows them, so stick with that for now.)

Test Plan

Pushed nonexistent refs:

$ git push origin :refs/tags/doesnotexist
remote: warning: Allowing deletion of corrupt ref.
To ssh://dweller@localhost/diffusion/POEMS/
 - [deleted]         doesnotexist
$ 

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

epriestley retitled this revision from to Respond more gracefully when a git push deletes a nonexistent ref.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
btrahan edited edge metadata.
This revision is now accepted and ready to land.Jul 10 2014, 5:01 PM
epriestley updated this revision to Diff 23704.

Closed by commit rP02c3200867b1 (authored by @epriestley).