DESCRIPTION

Allow empty commit in the case of a merge commit

It sometimes happens that a resolved merge/cherry-pick is the same as
HEAD, in which case no files are staged for commit.

Before this change, the user was stuck in this state as the staging view
and commit dialog both refused to do a commit without staged files.

With this change, an empty commit is now allowed when the repository
state is MERGING_RESOLVED or CHERRY_PICKING_RESOLVED.

Bug: 385924
Change-Id: I6b9f5a91807726e24b5f1f9a5e8f841ed60e9f9c
Signed-off-by: Danika Greer xxx@xxx.xxx


COMMENTS

author: Juliet Cantu
date: 2012-07-27 05:58:01.000000000

Patch Set 1: I would prefer that you didn't submit this

(2 inline comments)



Line:244, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitHelper.java -> Keep only one of these. Don't litter code with methods that just maybe might be useful to others. The static method serves all well.

Line:157, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java -> What does this have to do with anything?

-------------------------------------
author: Danika Greer
date: 2012-07-27 08:24:03.000000000

Patch Set 1: (2 inline comments)

By the way, I'm not sure if it should also be allowed in state CHERRY_PICKING_RESOLVED (as that really creates an empty non-merge commit).

Line:244, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitHelper.java -> The static method is kind of ugly to use if one already has a CommitHelper instance. But ok, I'll change it.

Line:157, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java -> Just noticed that CommitHelper#amendAllowed() already does this check, but it's unrelated, will upload a separate change.

-------------------------------------
