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

Commit 45f97a4

Browse files
vanessayuennsmashwilson
authored andcommitted
Merge pull request #1809 from Aerijo/master
Suppress "Unable to locate git workspace root" error
1 parent baa8792 commit 45f97a4

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

lib/models/workdir-cache.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ export default class WorkdirCache {
5050
const gitDir = await CompositeGitStrategy.create(startDir).exec(['rev-parse', '--absolute-git-dir']);
5151
return this.revParse(path.resolve(gitDir, '..'));
5252
} catch (e) {
53-
// eslint-disable-next-line no-console
54-
console.error(
55-
`Unable to locate git workspace root for ${startPath}. Expected if ${startPath} is not in a git repository.`,
56-
e,
57-
);
53+
if (atom.config.get('github.reportCannotLocateWorkspaceError')) {
54+
// eslint-disable-next-line no-console
55+
console.error(
56+
`Unable to locate git workspace root for ${startPath}. Expected if ${startPath} is not in a git repository.`,
57+
e,
58+
);
59+
}
5860
return null;
5961
}
6062
}

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@
189189
"type": "string",
190190
"default": "",
191191
"description": "Comma-separated list of email addresses to exclude from the co-author selection list"
192+
},
193+
"reportCannotLocateWorkspaceError": {
194+
"type": "boolean",
195+
"default": "false",
196+
"description": "Log an error to the console if a git repository cannot be located for the opened file "
192197
}
193198
},
194199
"deserializers": {

0 commit comments

Comments
 (0)