Page MenuHomePhabricator

D9800.diff
No OneTemporary

D9800.diff

diff --git a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
--- a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
+++ b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
@@ -477,7 +477,12 @@
$ref_flags = 0;
$dangerous = null;
- if ($ref_old === self::EMPTY_HASH) {
+ if (($ref_old === self::EMPTY_HASH) && ($ref_new === self::EMPTY_HASH)) {
+ // This happens if you try to delete a tag or branch which does not
+ // exist by pushing directly to the ref. Git will warn about it but
+ // allow it. Just call it a delete, without flagging it as dangerous.
+ $ref_flags |= PhabricatorRepositoryPushLog::CHANGEFLAG_DELETE;
+ } else if ($ref_old === self::EMPTY_HASH) {
$ref_flags |= PhabricatorRepositoryPushLog::CHANGEFLAG_ADD;
} else if ($ref_new === self::EMPTY_HASH) {
$ref_flags |= PhabricatorRepositoryPushLog::CHANGEFLAG_DELETE;

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 2, 12:50 PM (3 d, 6 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7587629
Default Alt Text
D9800.diff (1 KB)

Event Timeline