[Pkg-javascript-commits] [node-coveralls] 199/332: Accept more valid git branch names
Bastien Roucariès
rouca at moszumanska.debian.org
Thu Nov 9 13:54:00 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-coveralls.
commit 05c4f1f374e138f0ed0cab62d55f028841a36fe6
Author: Hauke Henningsen <sqrt at entless.org>
Date: Wed Apr 15 17:59:11 2015 +0200
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`.
---
lib/detectLocalGit.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-coveralls.git
More information about the Pkg-javascript-commits
mailing list