mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
parent
06cc08d9f7
commit
894d28c60b
@ -14,8 +14,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
var when = require('when');
|
|
||||||
|
|
||||||
var exec = require("../../../../exec");
|
var exec = require("../../../../exec");
|
||||||
|
|
||||||
var authResponseServer = require('./authServer').ResponseServer;
|
var authResponseServer = require('./authServer').ResponseServer;
|
||||||
@ -84,8 +82,12 @@ function runGitCommandWithAuth(args,cwd,auth,emit) {
|
|||||||
commandEnv.NODE_RED_GIT_NODE_PATH = process.execPath;
|
commandEnv.NODE_RED_GIT_NODE_PATH = process.execPath;
|
||||||
commandEnv.NODE_RED_GIT_SOCK_PATH = rs.path;
|
commandEnv.NODE_RED_GIT_SOCK_PATH = rs.path;
|
||||||
commandEnv.NODE_RED_GIT_ASKPASS_PATH = path.join(__dirname,"authWriter.js");
|
commandEnv.NODE_RED_GIT_ASKPASS_PATH = path.join(__dirname,"authWriter.js");
|
||||||
return runGitCommand(args,cwd,commandEnv,emit).finally(function() {
|
return runGitCommand(args,cwd,commandEnv,emit).then( result => {
|
||||||
rs.close();
|
rs.close();
|
||||||
|
return result;
|
||||||
|
}).catch(err => {
|
||||||
|
rs.close();
|
||||||
|
throw err;
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -104,8 +106,12 @@ function runGitCommandWithSSHCommand(args,cwd,auth,emit) {
|
|||||||
// GIT_SSH_COMMAND - added in git 2.3.0
|
// GIT_SSH_COMMAND - added in git 2.3.0
|
||||||
commandEnv.GIT_SSH_COMMAND = "ssh -i " + auth.key_path + " -F /dev/null";
|
commandEnv.GIT_SSH_COMMAND = "ssh -i " + auth.key_path + " -F /dev/null";
|
||||||
// console.log('commandEnv:', commandEnv);
|
// console.log('commandEnv:', commandEnv);
|
||||||
return runGitCommand(args,cwd,commandEnv,emit).finally(function() {
|
return runGitCommand(args,cwd,commandEnv,emit).then( result => {
|
||||||
rs.close();
|
rs.close();
|
||||||
|
return result;
|
||||||
|
}).catch(err => {
|
||||||
|
rs.close();
|
||||||
|
throw err;
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -362,7 +368,7 @@ function getBranchStatus(cwd,remoteBranch) {
|
|||||||
// #commits master behind
|
// #commits master behind
|
||||||
runGitCommand(['rev-list', '^HEAD',remoteBranch, '--count'],cwd)
|
runGitCommand(['rev-list', '^HEAD',remoteBranch, '--count'],cwd)
|
||||||
];
|
];
|
||||||
return when.all(commands).then(function(results) {
|
return Promise.all(commands).then(function(results) {
|
||||||
return {
|
return {
|
||||||
commits: {
|
commits: {
|
||||||
ahead: parseInt(results[0]),
|
ahead: parseInt(results[0]),
|
||||||
@ -589,7 +595,7 @@ module.exports = {
|
|||||||
runGitCommand(['rev-list', 'HEAD', '--count'],cwd),
|
runGitCommand(['rev-list', 'HEAD', '--count'],cwd),
|
||||||
runGitCommand(args,cwd).then(parseLog)
|
runGitCommand(args,cwd).then(parseLog)
|
||||||
];
|
];
|
||||||
return when.all(commands).then(function(results) {
|
return Promise.all(commands).then(function(results) {
|
||||||
var result = results[0];
|
var result = results[0];
|
||||||
result.count = results[1].length;
|
result.count = results[1].length;
|
||||||
result.before = before;
|
result.before = before;
|
||||||
|
Loading…
Reference in New Issue
Block a user