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 authored and GitHub committed 2020-10-06 13:38:18 +02:00
1 parent 8b399ed168
commit 9553dabbd8
4 files changed
+9 -6

No files matched your search

+2 -2
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')