Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1809 from Aerijo/master
Browse files Browse the repository at this point in the history
Suppress "Unable to locate git workspace root" error
  • Loading branch information
vanessayuenn committed Nov 27, 2018
2 parents b13dcef + 5be7bd6 commit 9fe9fcb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/models/workdir-cache.js
Expand Up @@ -50,11 +50,13 @@ export default class WorkdirCache {
const gitDir = await CompositeGitStrategy.create(startDir).exec(['rev-parse', '--absolute-git-dir']);
return this.revParse(path.resolve(gitDir, '..'));
} catch (e) {
// eslint-disable-next-line no-console
console.error(
`Unable to locate git workspace root for ${startPath}. Expected if ${startPath} is not in a git repository.`,
e,
);
if (atom.config.get('github.reportCannotLocateWorkspaceError')) {
// eslint-disable-next-line no-console
console.error(
`Unable to locate git workspace root for ${startPath}. Expected if ${startPath} is not in a git repository.`,
e,
);
}
return null;
}
}
Expand Down
5 changes: 5 additions & 0 deletions package.json
Expand Up @@ -189,6 +189,11 @@
"type": "string",
"default": "",
"description": "Comma-separated list of email addresses to exclude from the co-author selection list"
},
"reportCannotLocateWorkspaceError": {
"type": "boolean",
"default": "false",
"description": "Log an error to the console if a git repository cannot be located for the opened file "
}
},
"deserializers": {
Expand Down

0 comments on commit 9fe9fcb

Please sign in to comment.