mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 08:50:06 +02:00
rebase onto implemented
This commit is contained in:
parent
592399b1db
commit
521cc0e809
3 changed files with 41 additions and 8 deletions
|
@ -2165,6 +2165,21 @@ GitEngine.prototype.rebase = function(targetSource, currentLocation, options) {
|
|||
return this.rebaseFinish(toRebaseRough, stopSet, targetSource, currentLocation, options);
|
||||
};
|
||||
|
||||
GitEngine.prototype.rebaseOnto = function(targetSource, oldSource, unit, options) {
|
||||
if (this.isUpstreamOf(unit, targetSource)) {
|
||||
this.setTargetLocation(unit, this.getCommitFromRef(targetSource));
|
||||
this.command.setResult(intl.str('git-result-fastforward'));
|
||||
|
||||
this.checkout(unit);
|
||||
return;
|
||||
}
|
||||
|
||||
var stopSet = Graph.getUpstreamSet(this, targetSource);
|
||||
var oldBranchSet = Graph.getUpstreamSet(this, oldSource);
|
||||
var toRebaseRough = this.getUpstreamDiffFromSet(oldBranchSet, unit);
|
||||
return this.rebaseFinish(toRebaseRough, stopSet, targetSource, unit, options);
|
||||
};
|
||||
|
||||
GitEngine.prototype.getUpstreamDiffSetFromSet = function(stopSet, location) {
|
||||
var set = {};
|
||||
this.getUpstreamDiffFromSet(stopSet, location).forEach(function (commit) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue