mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-11 00:15:07 +00:00
update on rev2 on git log - fixes change branch for git projects
This commit is contained in:
parent
a0c562e402
commit
26daa4ce38
@ -39,6 +39,8 @@ content~~
|
||||
* projects list scroll
|
||||
* ~~Error during send: TypeError: Cannot read property 'changes' of undefined~~
|
||||
* Builds loss
|
||||
* ~~error on git after change branch: fatal: ambiguous argument '18a8ea4..branch':
|
||||
unknown revision or path not in the working tree.~~
|
||||
|
||||
|
||||
## Feature requests
|
||||
|
@ -133,12 +133,26 @@ Scm.prototype.getChanges = function(rev1, rev2, callback) {
|
||||
var self = this;
|
||||
Steppy(
|
||||
function() {
|
||||
// get current rev to update on it after git log
|
||||
self.getCurrent(this.slot());
|
||||
},
|
||||
function(err, currentRev) {
|
||||
this.pass(currentRev);
|
||||
|
||||
// update to rev2 to prevent git error when switch to branch that
|
||||
// doesn't exist locally: "unknown revision or path not in the
|
||||
// working tree"
|
||||
self.update(rev2, this.slot());
|
||||
},
|
||||
function(err, currentRev) {
|
||||
this.pass(currentRev);
|
||||
|
||||
self.run({cmd: 'git', args: [
|
||||
'log', rev1 ? rev1 + '..' + rev2 : rev2,
|
||||
'--pretty=' + self._revTemplate
|
||||
]}, this.slot());
|
||||
},
|
||||
function(err, stdout) {
|
||||
function(err, currentRev, stdout) {
|
||||
// always skip last line - it's empty
|
||||
var rows = stdout.split('\n').slice(0, -1);
|
||||
|
||||
@ -146,7 +160,12 @@ Scm.prototype.getChanges = function(rev1, rev2, callback) {
|
||||
return self._parseRev(str);
|
||||
});
|
||||
|
||||
this.pass(currentRev, changes);
|
||||
},
|
||||
function(err, currentRev, changes) {
|
||||
this.pass(changes);
|
||||
|
||||
self.update(currentRev.id, this.slot());
|
||||
},
|
||||
callback
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user