enforce absolute path for getGitPath

This commit is contained in:
ddorando 2023-09-06 19:10:10 +03:00
parent 32ebc90995
commit 19f4e8dd3e
2 changed files with 2 additions and 2 deletions

2
dist/index.js vendored
View file

@ -831,7 +831,7 @@ class GitCommandManager {
} }
getGitPath(path) { getGitPath(path) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const args = ['rev-parse', '--git-path']; const args = ['rev-parse', '--path-format=absolute', '--git-path'];
if (path) if (path)
args.push(path); args.push(path);
const output = yield this.exec(args); const output = yield this.exec(args);

View file

@ -147,7 +147,7 @@ export class GitCommandManager {
} }
async getGitPath(path?: string): Promise<string> { async getGitPath(path?: string): Promise<string> {
const args = ['rev-parse', '--git-path'] const args = ['rev-parse', '--path-format=absolute', '--git-path']
if (path) args.push(path) if (path) args.push(path)
const output = await this.exec(args) const output = await this.exec(args)
return output.stdout.trim() return output.stdout.trim()