]> khamidou — GitHub mirrors - arcanist.git/commit
arc amend: fix failure when amending merge commit
authorAndrew Gallagher <agallagher@fb.com>
Tue, 7 Jun 2011 03:57:04 +0000 (20:57 -0700)
committerAndrew Gallagher <agallagher@fb.com>
Wed, 8 Jun 2011 23:24:16 +0000 (16:24 -0700)
commitffbc7aae62c308cf1f22811474dac1d7c676ae8c
tree13da26d8bcbc0fa55b46738bc0833b5abd5f3246
parent9b7ee674eb40a80f427943afd33c68425adc0b8f
arc amend: fix failure when amending merge commit

Summary:
The amend process used "git log HEAD^..HEAD" to get log for the
commit being amended.  When run on a merge commit this can return
any number of commits from the non-first parents.  Since only a
single commit was expected, arc fails here.

This diff changes the amend process to use the '--first-parent' flag
to be consistent with using '^', which references the first parent.
This should guarantee a single commit log every time.

Test Plan:
arc amend on a merge commit

Reviewed By: epriestley
Reviewers: epriestley, jungejason
CC: aran, epriestley, andrewjcg
Differential Revision: 415
src/repository/api/git/ArcanistGitAPI.php