mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-04-22 01:22:02 +03:00
fix issue checking detached when git less than 2.22
This commit is contained in:
parent
c85684db76
commit
44e1b123fc
2 changed files with 9 additions and 11 deletions
8
dist/index.js
vendored
8
dist/index.js
vendored
|
@ -4887,11 +4887,9 @@ class GitCommandManager {
|
|||
}
|
||||
isDetached() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
// Note, this implementation uses "branch --show-current" because
|
||||
// "rev-parse --symbolic-full-name HEAD" can fail on a new repo
|
||||
// with nothing checked out.
|
||||
const output = yield this.execGit(['branch', '--show-current']);
|
||||
return output.stdout.trim() === '';
|
||||
// Note, "branch --show-current" would be simpler but isn't available until Git 2.22
|
||||
const output = yield this.execGit(['rev-parse', '--symbolic-full-nane', 'HEAD'], true);
|
||||
return !output.stdout.trim().startsWith('refs/heads/');
|
||||
});
|
||||
}
|
||||
lfsFetch(ref) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue