mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 16:38:50 +02:00
add git gc command
This commit is contained in:
parent
9d76f28ed9
commit
1e1c3a46e6
2 changed files with 10 additions and 2 deletions
|
@ -208,6 +208,14 @@ var commandConfig = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
gc: {
|
||||||
|
displayName: 'gc',
|
||||||
|
regex: /^git +gc($|\s)/,
|
||||||
|
execute: function(engine, command) {
|
||||||
|
engine.pruneTree(false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
pull: {
|
pull: {
|
||||||
regex: /^git +pull($|\s)/,
|
regex: /^git +pull($|\s)/,
|
||||||
options: [
|
options: [
|
||||||
|
|
|
@ -1836,7 +1836,7 @@ GitEngine.prototype.pruneTreeAndPlay = function() {
|
||||||
this.animationFactory.playRefreshAnimationSlow(this.gitVisuals);
|
this.animationFactory.playRefreshAnimationSlow(this.gitVisuals);
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.pruneTree = function() {
|
GitEngine.prototype.pruneTree = function(doPrintWarning = true) {
|
||||||
var set = this.getUpstreamBranchSet();
|
var set = this.getUpstreamBranchSet();
|
||||||
// don't prune commits that HEAD depends on
|
// don't prune commits that HEAD depends on
|
||||||
var headSet = Graph.getUpstreamSet(this, 'HEAD');
|
var headSet = Graph.getUpstreamSet(this, 'HEAD');
|
||||||
|
@ -1857,7 +1857,7 @@ GitEngine.prototype.pruneTree = function() {
|
||||||
// the switch sync
|
// the switch sync
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.command) {
|
if (this.command && doPrintWarning) {
|
||||||
this.command.addWarning(intl.str('hg-prune-tree'));
|
this.command.addWarning(intl.str('hg-prune-tree'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue