Skip to content

Commit

Permalink
fix: Ensure support for older versions of git
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Sep 17, 2020
1 parent 5c542a8 commit 1e15549
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/private/setup-repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const memoizee = require("memoizee")

const resolveCurrentBranch = async path =>
String(
(await runProgram("git", ["branch", "--show-current"], { cwd: path })).stdoutBuffer
// with git v2.22+ it could be: git branch --show-current
(await runProgram("git", ["rev-parse", "--abbrev-ref", "HEAD"], { cwd: path })).stdoutBuffer
).trim();

module.exports = memoizee(
Expand Down

0 comments on commit 1e15549

Please sign in to comment.