fix(gitfs): better git dir detection

This commit is contained in:
Rhys Arkins 2018-09-07 21:46:31 +02:00
parent 01acb25361
commit 55ded1cae1

View file

@ -38,9 +38,10 @@ class Storage {
config.platform,
config.repository
);
const gitHead = path.join(repoDir, '.git/HEAD');
let clone = true;
// istanbul ignore if
if (process.env.NODE_ENV !== 'test' && (await fs.exists(repoDir))) {
if (process.env.NODE_ENV !== 'test' && (await fs.exists(gitHead))) {
try {
git = Git(repoDir).silent(true);
await git.raw(['remote', 'set-url', 'origin', config.url]);