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
Unknown Object (File)
Mon, Dec 16, 12:10 PM
Unknown Object (File)
Thu, Dec 12, 8:46 AM
Unknown Object (File)
Mon, Dec 9, 1:31 PM
Unknown Object (File)
Sun, Dec 8, 11:27 PM
Unknown Object (File)
Sun, Dec 8, 6:00 AM
Unknown Object (File)
Wed, Dec 4, 3:26 AM
Unknown Object (File)
Fri, Nov 29, 11:36 PM
Unknown Object (File)
Tue, Nov 26, 11:58 AM
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).