Skip to content

Commit 1b4d0a0

Browse files
committed
Merge pull request #85 from addaleax/branch-name-detection
Accept more valid git branch names
2 parents 652d12f + 05c4f1f commit 1b4d0a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/detectLocalGit.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
var fs = require('fs');
22
var path = require('path');
33

4-
var REGEX_BRANCH = /^ref: refs\/heads\/(\w+)$/;
4+
// branch naming only has a few excluded characters, see git-check-ref-format(1)
5+
var REGEX_BRANCH = /^ref: refs\/heads\/([^?*\[\\~^:]+)$/;
56

67
module.exports = function detectLocalGit() {
78
var dir = process.cwd(), gitDir;

0 commit comments

Comments
 (0)