Remove usage of --no-auto-gc option (#42)

* Remove usage of --no-auto-gc option

This option is not supported in git versions < 2.23.
Older git versions might be used in self-hosted runners.

* Update CHANGELOG
This commit is contained in:
Michal Dorner 2020-10-06 13:38:18 +02:00 committed by GitHub
parent 8b399ed168
commit 9553dabbd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 6 deletions

View file

@ -21,7 +21,7 @@ export async function getChanges(ref: string): Promise<File[]> {
if (!(await hasCommit(ref))) {
// Fetch single commit
core.startGroup(`Fetching ${ref} from origin`)
await exec('git', ['fetch', '--depth=1', '--no-tags', '--no-auto-gc', 'origin', ref])
await exec('git', ['fetch', '--depth=1', '--no-tags', 'origin', ref])
core.endGroup()
}
@ -64,7 +64,7 @@ export async function getChangesSinceMergeBase(ref: string, initialFetchDepth: n
let deepen = initialFetchDepth
let lastCommitsCount = await countCommits()
do {
await exec('git', ['fetch', `--deepen=${deepen}`, '--no-tags', '--no-auto-gc'])
await exec('git', ['fetch', `--deepen=${deepen}`, '--no-tags'])
const count = await countCommits()
if (count <= lastCommitsCount) {
core.info('No merge base found - all files will be listed as added')