Homec4science

Respond more gracefully when a git push deletes a nonexistent ref

Authored by epriestley <git@epriestley.com> on Jul 10 2014, 19:17.

Description

Respond more gracefully when a git push deletes a nonexistent ref

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
$

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5534

Differential Revision: https://secure.phabricator.com/D9800

Details

Committed
epriestley <git@epriestley.com>Jul 10 2014, 19:17
Pushed
aubortJan 31 2017, 17:16
Parents
rPH16648c28bcd7: Add GROUP BY to commit query
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH02c3200867b1: Respond more gracefully when a git push deletes a nonexistent ref (authored by epriestley <git@epriestley.com>).Jul 10 2014, 19:17