diff --git a/red/runtime/storage/localfilesystem/projects/Project.js b/red/runtime/storage/localfilesystem/projects/Project.js index 8651ecc1a..4b8aa7210 100644 --- a/red/runtime/storage/localfilesystem/projects/Project.js +++ b/red/runtime/storage/localfilesystem/projects/Project.js @@ -381,7 +381,7 @@ Project.prototype.getFileDiff = function(file,type) { } Project.prototype.getCommits = function(options) { 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 { count:0, commits:[], @@ -733,6 +733,7 @@ Project.prototype.toJSON = function () { function getCredentialsFilename(filename) { + filename = filename || "undefined"; // TODO: DRY - ./index.js var ffDir = fspath.dirname(filename); var ffExt = fspath.extname(filename); @@ -741,6 +742,7 @@ function getCredentialsFilename(filename) { } function getBackupFilename(filename) { // TODO: DRY - ./index.js + filename = filename || "undefined"; var ffName = fspath.basename(filename); var ffDir = fspath.dirname(filename); return fspath.join(ffDir,"."+ffName+".backup"); diff --git a/red/runtime/storage/localfilesystem/projects/git/index.js b/red/runtime/storage/localfilesystem/projects/git/index.js index fec111858..c806a17f4 100644 --- a/red/runtime/storage/localfilesystem/projects/git/index.js +++ b/red/runtime/storage/localfilesystem/projects/git/index.js @@ -204,7 +204,7 @@ function getStatus(localRepo) { return runGitCommand(["status","--porcelain","-b"],localRepo).then(function(output) { var lines = output.split("\n"); 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) { if (line==="") { return;