]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Use --allow-empty when git amending to HEAD
authorChris Piro <cpiro@airtime.com>
Tue, 20 Dec 2011 00:12:13 +0000 (16:12 -0800)
committerChris Piro <cpiro@airtime.com>
Tue, 20 Dec 2011 21:21:58 +0000 (13:21 -0800)
Summary: ... in case the head commit is empty. Empty commits are useful for
injecting an Arcanist commit message in a branch then sending the whole thing
off for review. As far as I know there is no situation in which an empty commit
would exist unintentionally and using ##--allow-empty## would suppress an error.

Test Plan: works fine for a branch I just sent for review

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley
Differential Revision: 1241

src/repository/api/git/ArcanistGitAPI.php

index fd20e2e86c974c19fa035c99657ff62633a0ea97..fd50d2ebca45eafb8010a5be6cfefb4dbbaf82a8 100644 (file)
@@ -321,7 +321,7 @@ class ArcanistGitAPI extends ArcanistRepositoryAPI {
 
   public function amendGitHeadCommit($message) {
     execx(
-      '(cd %s; git commit --amend --message %s)',
+      '(cd %s; git commit --amend --allow-empty --message %s)',
       $this->getPath(),
       $message);
   }