Skip to content

Commit

Permalink
📝 Formatting and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dideler committed Jun 10, 2018
1 parent 8075095 commit b04574d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,14 @@ function gitPath(path) {
const [, mayor, minor] = /.*(\d)\.(\d*)\.(\d*)/gm.exec(version);

if (mayor >= 2 && minor >= 13) {
return silentRun(` git rev-parse --git-path ${path}`).stdout.trim();
return silentRun(`git rev-parse --git-path ${path}`).stdout.trim();
}

return silentRun(`git rev-parse --show-cdup | tr -d '\n' && git rev-parse --git-path ${path}`).stdout.trim();
// Git pre-v2.13 does not give relative path to GIT_DIR for `rev-parse --git-path`.
// Prefix relative path with `--show-cdup`.
return silentRun(
`git rev-parse --show-cdup | tr -d '\n' && git rev-parse --git-path ${path}`
).stdout.trim();
}

/**
Expand Down

0 comments on commit b04574d

Please sign in to comment.