diff options
author | Tomasz Zarna <tomasz.zarna@tasktop.com> | 2012-01-12 18:32:53 +0100 |
---|---|---|
committer | Tomasz Zarna <tomasz.zarna@tasktop.com> | 2013-04-04 15:11:49 +0200 |
commit | 545358577376bec8fc140a76ce0f72bf81cc0a94 (patch) | |
tree | 410629280cc5f6a62a09334b0a28937214539928 /org.eclipse.jgit.pgm/src/org/eclipse | |
parent | 81b601de53125bbcd30620b58168154d7541d8ad (diff) | |
download | jgit-545358577376bec8fc140a76ce0f72bf81cc0a94.tar.gz jgit-545358577376bec8fc140a76ce0f72bf81cc0a94.zip |
Add the no-commit option to MergeCommand
Added also tests and the associated option for the command line Merge
command.
Bug: 335091
Change-Id: Ie321c572284a6f64765a81674089fc408a10d059
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java | 1 | ||||
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java index 807fe39db9..64bd18e867 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CLIText.java @@ -137,6 +137,7 @@ public class CLIText extends TranslationBundle { /***/ public String mergeFailed; /***/ public String mergeMadeBy; /***/ public String mergedSquashed; + /***/ public String mergeWentWellStoppedBeforeCommitting; /***/ public String metaVar_KEY; /***/ public String metaVar_archiveFormat; /***/ public String metaVar_arg; diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java index 7eaa5fa351..97198259d3 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Merge.java @@ -71,6 +71,9 @@ class Merge extends TextBuiltin { @Option(name = "--squash", usage = "usage_squash") private boolean squash; + @Option(name = "--no-commit", usage = "usage_noCommit") + private boolean noCommit = false; + private MergeStrategy mergeStrategy = MergeStrategy.RESOLVE; @Argument(required = true) @@ -111,7 +114,7 @@ class Merge extends TextBuiltin { Ref oldHead = db.getRef(Constants.HEAD); Git git = new Git(db); MergeCommand mergeCmd = git.merge().setStrategy(mergeStrategy) - .setSquash(squash).setFastForward(ff); + .setSquash(squash).setFastForward(ff).setCommit(!noCommit); if (srcRef != null) mergeCmd.include(srcRef); else @@ -160,8 +163,12 @@ class Merge extends TextBuiltin { name = "recursive"; //$NON-NLS-1$ outw.println(MessageFormat.format(CLIText.get().mergeMadeBy, name)); break; + case MERGED_NOT_COMMITTED: + outw.println(CLIText.get().mergeWentWellStoppedBeforeCommitting); + break; case MERGED_SQUASHED: case FAST_FORWARD_SQUASHED: + case MERGED_SQUASHED_NOT_COMMITTED: outw.println(CLIText.get().mergedSquashed); break; case ABORTED: |