mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Handle more git 2.1 differences
This commit is contained in:
		@@ -381,7 +381,7 @@ Project.prototype.getFileDiff = function(file,type) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
Project.prototype.getCommits = function(options) {
 | 
					Project.prototype.getCommits = function(options) {
 | 
				
			||||||
    return gitTools.getCommits(this.path,options).catch(function(err) {
 | 
					    return gitTools.getCommits(this.path,options).catch(function(err) {
 | 
				
			||||||
        if (/ambiguous argument/.test(err.message) || /does not have any commits yet/.test(err.message)) {
 | 
					        if (/bad default revision/i.test(err.message) || /ambiguous argument/i.test(err.message) || /does not have any commits yet/i.test(err.message)) {
 | 
				
			||||||
            return {
 | 
					            return {
 | 
				
			||||||
                count:0,
 | 
					                count:0,
 | 
				
			||||||
                commits:[],
 | 
					                commits:[],
 | 
				
			||||||
@@ -733,6 +733,7 @@ Project.prototype.toJSON = function () {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function getCredentialsFilename(filename) {
 | 
					function getCredentialsFilename(filename) {
 | 
				
			||||||
 | 
					    filename = filename || "undefined";
 | 
				
			||||||
    // TODO: DRY - ./index.js
 | 
					    // TODO: DRY - ./index.js
 | 
				
			||||||
    var ffDir = fspath.dirname(filename);
 | 
					    var ffDir = fspath.dirname(filename);
 | 
				
			||||||
    var ffExt = fspath.extname(filename);
 | 
					    var ffExt = fspath.extname(filename);
 | 
				
			||||||
@@ -741,6 +742,7 @@ function getCredentialsFilename(filename) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
function getBackupFilename(filename) {
 | 
					function getBackupFilename(filename) {
 | 
				
			||||||
    // TODO: DRY - ./index.js
 | 
					    // TODO: DRY - ./index.js
 | 
				
			||||||
 | 
					    filename = filename || "undefined";
 | 
				
			||||||
    var ffName = fspath.basename(filename);
 | 
					    var ffName = fspath.basename(filename);
 | 
				
			||||||
    var ffDir = fspath.dirname(filename);
 | 
					    var ffDir = fspath.dirname(filename);
 | 
				
			||||||
    return fspath.join(ffDir,"."+ffName+".backup");
 | 
					    return fspath.join(ffDir,"."+ffName+".backup");
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -204,7 +204,7 @@ function getStatus(localRepo) {
 | 
				
			|||||||
            return runGitCommand(["status","--porcelain","-b"],localRepo).then(function(output) {
 | 
					            return runGitCommand(["status","--porcelain","-b"],localRepo).then(function(output) {
 | 
				
			||||||
                var lines = output.split("\n");
 | 
					                var lines = output.split("\n");
 | 
				
			||||||
                var unknownDirs = [];
 | 
					                var unknownDirs = [];
 | 
				
			||||||
                var branchLineRE = /^## (?:No commits yet on )?(.+?)(?:$|\.\.\.(.+?)(?:$| \[(?:(?:ahead (\d+)(?:,\s*)?)?(?:behind (\d+))?|(gone))\]))/;
 | 
					                var branchLineRE = /^## (?:(?:No commits yet on )|(?:Initial commit on))?(.+?)(?:$|\.\.\.(.+?)(?:$| \[(?:(?:ahead (\d+)(?:,\s*)?)?(?:behind (\d+))?|(gone))\]))/;
 | 
				
			||||||
                lines.forEach(function(line) {
 | 
					                lines.forEach(function(line) {
 | 
				
			||||||
                    if (line==="") {
 | 
					                    if (line==="") {
 | 
				
			||||||
                        return;
 | 
					                        return;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user