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)
Fri, May 3, 2:55 AM
Unknown Object (File)
Mon, Apr 29, 2:28 PM
Unknown Object (File)
Wed, Apr 24, 10:07 PM
Unknown Object (File)
Mon, Apr 22, 12:58 PM
Unknown Object (File)
Fri, Apr 12, 7:21 AM
Unknown Object (File)
Tue, Apr 9, 9:37 AM
Unknown Object (File)
Tue, Apr 9, 9:37 AM
Unknown Object (File)
Tue, Apr 9, 9:14 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).