mirror of
https://github.com/actions/setup-go.git
synced 2025-04-23 17:40:50 +00:00
Fix gitFetch not updating FETCH_HEAD
This commit is contained in:
parent
c087bf9a31
commit
10a88fa7b0
2 changed files with 4 additions and 2 deletions
|
@ -43,11 +43,13 @@ export async function gitClone(gitDir: string, gitRepo: string, workTree: string
|
||||||
await git(args);
|
await git(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function gitFetch(gitDir: string) {
|
export async function gitFetch(gitDir: string, ref: string) {
|
||||||
let args: string[] = [
|
let args: string[] = [
|
||||||
`--git-dir=${gitDir}`,
|
`--git-dir=${gitDir}`,
|
||||||
'fetch',
|
'fetch',
|
||||||
'--depth=1',
|
'--depth=1',
|
||||||
|
'origin',
|
||||||
|
ref,
|
||||||
];
|
];
|
||||||
await git(args);
|
await git(args);
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ async function acquireGo(version: string, gotipRef: string, bootstrapGo: string)
|
||||||
workTree = '';
|
workTree = '';
|
||||||
|
|
||||||
// Cache hit for git dir, fetch new commits from upstream.
|
// Cache hit for git dir, fetch new commits from upstream.
|
||||||
await executil.gitFetch(gitDir);
|
await executil.gitFetch(gitDir, gotipRef);
|
||||||
|
|
||||||
// Extract latest commit hash.
|
// Extract latest commit hash.
|
||||||
commitHash = await executil.gitRevParse(gitDir, 'FETCH_HEAD');
|
commitHash = await executil.gitRevParse(gitDir, 'FETCH_HEAD');
|
||||||
|
|
Loading…
Add table
Reference in a new issue