diff options
| author | Hauke Henningsen <[email protected]> | 2015-04-15 17:59:11 +0200 |
|---|---|---|
| committer | Hauke Henningsen <[email protected]> | 2015-04-15 17:59:11 +0200 |
| commit | 05c4f1f374e138f0ed0cab62d55f028841a36fe6 (patch) | |
| tree | bac89e56b7cced2d8360974b50bd9014e361a9a9 | |
| parent | d5e1372bbd79a9fabbceec9624a220f1a8f75348 (diff) | |
| download | node-coveralls-05c4f1f374e138f0ed0cab62d55f028841a36fe6.tar.xz node-coveralls-05c4f1f374e138f0ed0cab62d55f028841a36fe6.zip | |
Accept more valid git branch names
According to git-check-ref-format(1), branch naming excludes
a number of characters, but various non-word characters are
definitely allowed.
This modifies the `REGEX_BRANCH` detection to match branch names
containing some non-word characters, e.g. `features/foo` or `bar-baz`.
| -rw-r--r-- | lib/detectLocalGit.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/detectLocalGit.js b/lib/detectLocalGit.js index 302cd44..bc9b6c4 100644 --- a/lib/detectLocalGit.js +++ b/lib/detectLocalGit.js @@ -1,7 +1,8 @@ var fs = require('fs'); var path = require('path'); -var REGEX_BRANCH = /^ref: refs\/heads\/(\w+)$/; +// branch naming only has a few excluded characters, see git-check-ref-format(1) +var REGEX_BRANCH = /^ref: refs\/heads\/([^?*\[\\~^:]+)$/; module.exports = function detectLocalGit(knownCommit, knownBranch) { var dir = process.cwd(), gitDir; |
