mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
fix(gitfs): better git dir detection
This commit is contained in:
parent
01acb25361
commit
55ded1cae1
1 changed files with 2 additions and 1 deletions
|
@ -38,9 +38,10 @@ class Storage {
|
||||||
config.platform,
|
config.platform,
|
||||||
config.repository
|
config.repository
|
||||||
);
|
);
|
||||||
|
const gitHead = path.join(repoDir, '.git/HEAD');
|
||||||
let clone = true;
|
let clone = true;
|
||||||
// istanbul ignore if
|
// istanbul ignore if
|
||||||
if (process.env.NODE_ENV !== 'test' && (await fs.exists(repoDir))) {
|
if (process.env.NODE_ENV !== 'test' && (await fs.exists(gitHead))) {
|
||||||
try {
|
try {
|
||||||
git = Git(repoDir).silent(true);
|
git = Git(repoDir).silent(true);
|
||||||
await git.raw(['remote', 'set-url', 'origin', config.url]);
|
await git.raw(['remote', 'set-url', 'origin', config.url]);
|
||||||
|
|
Loading…
Reference in a new issue