mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-09-01 08:17:16 +02:00
refactor: replace all master to main
This commit is contained in:
parent
4148f0b846
commit
b7ac2851c6
55 changed files with 431 additions and 455 deletions
|
@ -550,8 +550,8 @@ GitVisuals.prototype.calcBranchStacks = function() {
|
|||
map[thisId].sort(function(a, b) {
|
||||
var aId = a.obj.get('id');
|
||||
var bId = b.obj.get('id');
|
||||
if (aId == 'master' || bId == 'master') {
|
||||
return aId == 'master' ? -1 : 1;
|
||||
if (aId == 'main' || bId == 'main') {
|
||||
return aId == 'main' ? -1 : 1;
|
||||
}
|
||||
return aId.localeCompare(bId);
|
||||
});
|
||||
|
|
|
@ -68,7 +68,7 @@ var VisBranch = VisBase.extend({
|
|||
this.refreshOffset();
|
||||
|
||||
this.set('fill', GRAPHICS.headRectFill);
|
||||
} else if (id !== 'master') {
|
||||
} else if (id !== 'main') {
|
||||
// we need to set our color to something random
|
||||
this.set('fill', randomHueString());
|
||||
}
|
||||
|
@ -103,16 +103,16 @@ var VisBranch = VisBase.extend({
|
|||
* compared in the goal (used in a goal visualization context
|
||||
*/
|
||||
getIsLevelBranchCompared: function() {
|
||||
if (this.getIsMaster()) {
|
||||
return true; // master always compared
|
||||
if (this.getIsMain()) {
|
||||
return true; // main always compared
|
||||
}
|
||||
// we are not master, so return true if its not just master being compared
|
||||
// we are not main, so return true if its not just main being compared
|
||||
var levelBlob = this.get('gitVisuals').getLevelBlob();
|
||||
return !TreeCompare.onlyMasterCompared(levelBlob);
|
||||
return !TreeCompare.onlyMainCompared(levelBlob);
|
||||
},
|
||||
|
||||
getIsMaster: function() {
|
||||
return this.get('branch').get('id') == 'master';
|
||||
getIsMain: function() {
|
||||
return this.get('branch').get('id') == 'main';
|
||||
},
|
||||
|
||||
getFlipValue: function(commit, visNode) {
|
||||
|
@ -357,9 +357,6 @@ var VisBranch = VisBase.extend({
|
|||
if (name === 'HEAD' && isHg) {
|
||||
name = '.';
|
||||
}
|
||||
if (name.match(/\bmaster\b/)) {
|
||||
name = name.replace(/\bmaster\b/, 'main');
|
||||
}
|
||||
|
||||
var after = (selected && !this.getIsInOrigin() && !isRemote) ? '*' : '';
|
||||
return name + after;
|
||||
|
|
|
@ -81,9 +81,9 @@ var VisTag = VisBase.extend({
|
|||
* compared in the goal (used in a goal visualization context
|
||||
*/
|
||||
getIsLevelTagCompared: function() {
|
||||
// we are not master, so return true if its not just master being compared
|
||||
// we are not main, so return true if its not just main being compared
|
||||
var levelBlob = this.get('gitVisuals').getLevelBlob();
|
||||
return !TreeCompare.onlyMasterCompared(levelBlob);
|
||||
return !TreeCompare.onlyMainCompared(levelBlob);
|
||||
},
|
||||
|
||||
getTagStackIndex: function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue