Skip to content

Commit

Permalink
git-gui: Allow committing empty merges
Browse files Browse the repository at this point in the history
Johannes Sixt noticed that git-gui would not let the user commit
a merge created by `git merge -s ours` as the ours strategy does
not alter the tree (that is HEAD^1^{tree} = HEAD^{tree} after the
merge).  The same issue arises from amending such a merge commit.

We now permit an empty commit (no changed files) if we are doing
a merge commit.  Core Git does this with its command line based
git-commit tool, so it makes sense for the GUI to do the same.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information
Shawn O. Pearce committed Mar 12, 2007
1 parent 0b5ea16 commit c7bafad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ File [short_path $path] cannot be committed by this program.
}
}
}
if {!$files_ready} {
if {!$files_ready && ![string match *merge $curType]} {
info_popup {No changes to commit.

You must add at least 1 file before you can commit.
Expand Down

0 comments on commit c7bafad

Please sign in to comment.