From 4d6d247d015043a7b1bd8e6c6fbcf9f56a66183f Mon Sep 17 00:00:00 2001 From: Aaron Schrab Date: Wed, 20 Feb 2013 22:20:46 -0500 Subject: [PATCH] No multiple arguments for merge `git merge` should only be given multiple arguments if doing an octopus merge which isn't currently supported. Require that exactly one argument be given, and always use HEAD as the currentLocation. --- src/js/git/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/git/index.js b/src/js/git/index.js index 8749c720..2177bf26 100644 --- a/src/js/git/index.js +++ b/src/js/git/index.js @@ -1158,9 +1158,9 @@ GitEngine.prototype.rebaseFinish = function(toRebaseRough, stopSet, targetSource }; GitEngine.prototype.mergeStarter = function() { - this.twoArgsImpliedHead(this.generalArgs); + this.validateArgBounds(this.generalArgs, 1, 1); - var newCommit = this.merge(this.generalArgs[0], this.generalArgs[1]); + var newCommit = this.merge(this.generalArgs[0]); if (newCommit === undefined) { // its just a fast forwrard @@ -1171,7 +1171,9 @@ GitEngine.prototype.mergeStarter = function() { this.animationFactory.genCommitBirthAnimation(this.animationQueue, newCommit, this.gitVisuals); }; -GitEngine.prototype.merge = function(targetSource, currentLocation) { +GitEngine.prototype.merge = function(targetSource) { + var currentLocation = 'HEAD'; + // first some conditions if (this.isUpstreamOf(targetSource, currentLocation) || this.getCommitFromRef(targetSource) === this.getCommitFromRef(currentLocation)) {