mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 00:18:56 +02:00
Merge pull request #49 from aschrab/merge-args
Fix merge argument handling
This commit is contained in:
commit
c50b413f3a
2 changed files with 8 additions and 6 deletions
|
@ -1158,9 +1158,9 @@ GitEngine.prototype.rebaseFinish = function(toRebaseRough, stopSet, targetSource
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.mergeStarter = function() {
|
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) {
|
if (newCommit === undefined) {
|
||||||
// its just a fast forwrard
|
// its just a fast forwrard
|
||||||
|
@ -1171,7 +1171,9 @@ GitEngine.prototype.mergeStarter = function() {
|
||||||
this.animationFactory.genCommitBirthAnimation(this.animationQueue, newCommit, this.gitVisuals);
|
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
|
// first some conditions
|
||||||
if (this.isUpstreamOf(targetSource, currentLocation) ||
|
if (this.isUpstreamOf(targetSource, currentLocation) ||
|
||||||
this.getCommitFromRef(targetSource) === this.getCommitFromRef(currentLocation)) {
|
this.getCommitFromRef(targetSource) === this.getCommitFromRef(currentLocation)) {
|
||||||
|
|
|
@ -37,7 +37,7 @@ exports.level = {
|
||||||
"",
|
"",
|
||||||
"So here we see that the `master` branch color is blended into all the commits, but the `bugFix` color is not. Let's fix that..."
|
"So here we see that the `master` branch color is blended into all the commits, but the `bugFix` color is not. Let's fix that..."
|
||||||
],
|
],
|
||||||
"command": "git merge bugFix master",
|
"command": "git merge bugFix",
|
||||||
"beforeCommand": "git checkout -b bugFix; git commit; git checkout master; git commit"
|
"beforeCommand": "git checkout -b bugFix; git commit; git checkout master; git commit"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -52,8 +52,8 @@ exports.level = {
|
||||||
"",
|
"",
|
||||||
"Now all the commits are the same color, which means each branch contains all the work in the repository! Woohoo"
|
"Now all the commits are the same color, which means each branch contains all the work in the repository! Woohoo"
|
||||||
],
|
],
|
||||||
"command": "git merge master bugFix",
|
"command": "git checkout bugFix; git merge master",
|
||||||
"beforeCommand": "git checkout -b bugFix; git commit; git checkout master; git commit; git merge bugFix master"
|
"beforeCommand": "git checkout -b bugFix; git commit; git checkout master; git commit; git merge bugFix"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue