diff --git a/dist/index.js b/dist/index.js index 0e60e13b7..3b069ad75 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4888,7 +4888,7 @@ class GitCommandManager { isDetached() { return __awaiter(this, void 0, void 0, function* () { // Note, "branch --show-current" would be simpler but isn't available until Git 2.22 - const output = yield this.execGit(['rev-parse', '--symbolic-full-name', 'HEAD'], true); + const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true); return !output.stdout.trim().startsWith('refs/heads/'); }); } diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 0e75a8693..8085b80b1 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -172,7 +172,7 @@ class GitCommandManager { async isDetached(): Promise { // Note, "branch --show-current" would be simpler but isn't available until Git 2.22 const output = await this.execGit( - ['rev-parse', '--symbolic-full-name', 'HEAD'], + ['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true ) return !output.stdout.trim().startsWith('refs/heads/')