mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 16:08:34 +02:00
bit of remote work
This commit is contained in:
parent
8a4f8baafb
commit
af632eaa5e
6 changed files with 55 additions and 1142 deletions
|
@ -7924,10 +7924,10 @@ GitEngine.prototype.push = function(options) {
|
||||||
|
|
||||||
// HAX HAX update o/master
|
// HAX HAX update o/master
|
||||||
chain = chain.then(_.bind(function() {
|
chain = chain.then(_.bind(function() {
|
||||||
var localLocationID = localBranch.get('target').get('id');
|
var localCommit = this.getCommitFromRef(localBranch);
|
||||||
var localCommit = this.refs[localLocationID];
|
var remoteBranchID = localBranch.getRemoteBranchIDFromTracking();
|
||||||
// HAX HAX
|
// less hacks hax
|
||||||
this.setTargetLocation(this.refs['o/master'], localCommit);
|
this.setTargetLocation(this.refs[remoteBranchID], localCommit);
|
||||||
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
|
@ -9278,9 +9278,23 @@ var Ref = Backbone.Model.extend({
|
||||||
var Branch = Ref.extend({
|
var Branch = Ref.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
visBranch: null,
|
visBranch: null,
|
||||||
|
remoteTrackingBranch: null,
|
||||||
remote: false
|
remote: false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getRemoteBranchIDFromTracking: function() {
|
||||||
|
if (this.getIsRemote()) {
|
||||||
|
throw new Error('I am a remote branch! dont try to get remote from me');
|
||||||
|
}
|
||||||
|
// TODO check if remote tracking also
|
||||||
|
return 'o/' + this.getRemoteTrackingBranchName();
|
||||||
|
},
|
||||||
|
|
||||||
|
getRemoteTrackingBranchName: function() {
|
||||||
|
var originBranchName = this.get('remoteTrackingBranch');
|
||||||
|
return (originBranchName) ? originBranchName : this.get('id');
|
||||||
|
},
|
||||||
|
|
||||||
getIsRemote: function() {
|
getIsRemote: function() {
|
||||||
return this.get('remote');
|
return this.get('remote');
|
||||||
},
|
},
|
||||||
|
@ -24075,10 +24089,10 @@ GitEngine.prototype.push = function(options) {
|
||||||
|
|
||||||
// HAX HAX update o/master
|
// HAX HAX update o/master
|
||||||
chain = chain.then(_.bind(function() {
|
chain = chain.then(_.bind(function() {
|
||||||
var localLocationID = localBranch.get('target').get('id');
|
var localCommit = this.getCommitFromRef(localBranch);
|
||||||
var localCommit = this.refs[localLocationID];
|
var remoteBranchID = localBranch.getRemoteBranchIDFromTracking();
|
||||||
// HAX HAX
|
// less hacks hax
|
||||||
this.setTargetLocation(this.refs['o/master'], localCommit);
|
this.setTargetLocation(this.refs[remoteBranchID], localCommit);
|
||||||
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
|
@ -25429,9 +25443,23 @@ var Ref = Backbone.Model.extend({
|
||||||
var Branch = Ref.extend({
|
var Branch = Ref.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
visBranch: null,
|
visBranch: null,
|
||||||
|
remoteTrackingBranch: null,
|
||||||
remote: false
|
remote: false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getRemoteBranchIDFromTracking: function() {
|
||||||
|
if (this.getIsRemote()) {
|
||||||
|
throw new Error('I am a remote branch! dont try to get remote from me');
|
||||||
|
}
|
||||||
|
// TODO check if remote tracking also
|
||||||
|
return 'o/' + this.getRemoteTrackingBranchName();
|
||||||
|
},
|
||||||
|
|
||||||
|
getRemoteTrackingBranchName: function() {
|
||||||
|
var originBranchName = this.get('remoteTrackingBranch');
|
||||||
|
return (originBranchName) ? originBranchName : this.get('id');
|
||||||
|
},
|
||||||
|
|
||||||
getIsRemote: function() {
|
getIsRemote: function() {
|
||||||
return this.get('remote');
|
return this.get('remote');
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because one or more lines are too long
1
build/bundle.min.js
vendored
1
build/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
|
@ -427,7 +427,7 @@
|
||||||
For a much easier time perusing the source, see the individual files at:
|
For a much easier time perusing the source, see the individual files at:
|
||||||
https://github.com/pcottle/learnGitBranching
|
https://github.com/pcottle/learnGitBranching
|
||||||
-->
|
-->
|
||||||
<script src="build/bundle.min.8854fb9b.js"></script>
|
<script src="build/bundle.js"></script>
|
||||||
|
|
||||||
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
|
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
|
||||||
The downside? No raw logs to parse for analytics, so I have to include
|
The downside? No raw logs to parse for analytics, so I have to include
|
||||||
|
|
|
@ -879,10 +879,10 @@ GitEngine.prototype.push = function(options) {
|
||||||
|
|
||||||
// HAX HAX update o/master
|
// HAX HAX update o/master
|
||||||
chain = chain.then(_.bind(function() {
|
chain = chain.then(_.bind(function() {
|
||||||
var localLocationID = localBranch.get('target').get('id');
|
var localCommit = this.getCommitFromRef(localBranch);
|
||||||
var localCommit = this.refs[localLocationID];
|
var remoteBranchID = localBranch.getRemoteBranchIDFromTracking();
|
||||||
// HAX HAX
|
// less hacks hax
|
||||||
this.setTargetLocation(this.refs['o/master'], localCommit);
|
this.setTargetLocation(this.refs[remoteBranchID], localCommit);
|
||||||
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
|
||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
|
@ -2233,9 +2233,23 @@ var Ref = Backbone.Model.extend({
|
||||||
var Branch = Ref.extend({
|
var Branch = Ref.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
visBranch: null,
|
visBranch: null,
|
||||||
|
remoteTrackingBranch: null,
|
||||||
remote: false
|
remote: false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getRemoteBranchIDFromTracking: function() {
|
||||||
|
if (this.getIsRemote()) {
|
||||||
|
throw new Error('I am a remote branch! dont try to get remote from me');
|
||||||
|
}
|
||||||
|
// TODO check if remote tracking also
|
||||||
|
return 'o/' + this.getRemoteTrackingBranchName();
|
||||||
|
},
|
||||||
|
|
||||||
|
getRemoteTrackingBranchName: function() {
|
||||||
|
var originBranchName = this.get('remoteTrackingBranch');
|
||||||
|
return (originBranchName) ? originBranchName : this.get('id');
|
||||||
|
},
|
||||||
|
|
||||||
getIsRemote: function() {
|
getIsRemote: function() {
|
||||||
return this.get('remote');
|
return this.get('remote');
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue