mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 00:40:07 +02:00
Replace '_.filter' to 'Array.prototype.filter'
This commit is contained in:
parent
e324e51587
commit
dddf063146
2 changed files with 6 additions and 6 deletions
|
@ -755,14 +755,14 @@ GitEngine.prototype.getBranches = function() {
|
||||||
|
|
||||||
GitEngine.prototype.getRemoteBranches = function() {
|
GitEngine.prototype.getRemoteBranches = function() {
|
||||||
var all = this.getBranches();
|
var all = this.getBranches();
|
||||||
return _.filter(all, function(branchJSON) {
|
return all.filter(function(branchJSON) {
|
||||||
return branchJSON.remote === true;
|
return branchJSON.remote === true;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
GitEngine.prototype.getLocalBranches = function() {
|
GitEngine.prototype.getLocalBranches = function() {
|
||||||
var all = this.getBranches();
|
var all = this.getBranches();
|
||||||
return _.filter(all, function(branchJSON) {
|
return all.filter(function(branchJSON) {
|
||||||
return branchJSON.remote === false;
|
return branchJSON.remote === false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -1131,7 +1131,7 @@ GitEngine.prototype.push = function(options) {
|
||||||
// and remote master might be commits C2, C3, and C4, but the remote
|
// and remote master might be commits C2, C3, and C4, but the remote
|
||||||
// might already have those commits. In this case, we don't need to
|
// might already have those commits. In this case, we don't need to
|
||||||
// make them, so filter these out
|
// make them, so filter these out
|
||||||
commitsToMake = _.filter(commitsToMake, function(commitJSON) {
|
commitsToMake = commitsToMake.filter(function(commitJSON) {
|
||||||
return !this.origin.refs[commitJSON.id];
|
return !this.origin.refs[commitJSON.id];
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
|
@ -1305,7 +1305,7 @@ GitEngine.prototype.fetchCore = function(sourceDestPairs, options) {
|
||||||
// and remote master might be commits C2, C3, and C4, but we
|
// and remote master might be commits C2, C3, and C4, but we
|
||||||
// might already have those commits. In this case, we don't need to
|
// might already have those commits. In this case, we don't need to
|
||||||
// make them, so filter these out
|
// make them, so filter these out
|
||||||
commitsToMake = _.filter(commitsToMake, function(commitJSON) {
|
commitsToMake = commitsToMake.filter(function(commitJSON) {
|
||||||
return !this.refs[commitJSON.id];
|
return !this.refs[commitJSON.id];
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
|
@ -2315,7 +2315,7 @@ GitEngine.prototype.filterRebaseCommits = function(
|
||||||
var uniqueIDs = {};
|
var uniqueIDs = {};
|
||||||
|
|
||||||
// resolve the commits we will rebase
|
// resolve the commits we will rebase
|
||||||
return _.filter(toRebaseRough, function(commit) {
|
return toRebaseRough.filter(function(commit) {
|
||||||
// no merge commits, unless we preserve
|
// no merge commits, unless we preserve
|
||||||
if (commit.get('parents').length !== 1 && !options.preserveMerges) {
|
if (commit.get('parents').length !== 1 && !options.preserveMerges) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -235,7 +235,7 @@ var LevelDropdownView = ContainedBase.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
getSequencesOnTab: function() {
|
getSequencesOnTab: function() {
|
||||||
return _.filter(this.sequences, function(sequenceName) {
|
return this.sequences.filter(function(sequenceName) {
|
||||||
var tab = LEVELS.getTabForSequence(sequenceName);
|
var tab = LEVELS.getTabForSequence(sequenceName);
|
||||||
return tab === this.JSON.selectedTab;
|
return tab === this.JSON.selectedTab;
|
||||||
}, this);
|
}, this);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue