aboutsummaryrefslogtreecommitdiff
path: root/lib/detectLocalGit.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/detectLocalGit.js')
-rw-r--r--lib/detectLocalGit.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/detectLocalGit.js b/lib/detectLocalGit.js
index 773eb70..ac8ed29 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() {
var dir = process.cwd(), gitDir;