Introduce smart fetching, based on type of local repo.

This commit is contained in:
Webber
2020-05-01 14:17:30 +02:00
committed by Webber Takken
parent cd1d215dfa
commit b41026b36e
3 changed files with 10 additions and 2 deletions

View File

@@ -131,10 +131,17 @@ export default class Versioning {
/**
* Retrieves refs from the configured remote.
*
* Fetch unshallow for incomplete repository, but fall back to normal fetch.
*
* Note: `--all` should not be used, and would break fetching for push event.
*/
static async fetch() {
await System.run('git', ['fetch']);
try {
await System.run('git', ['fetch', '--unshallow']);
} catch (error) {
core.warning(error);
await System.run('git', ['fetch']);
}
}
/**