Resolves #164 case insensitive branch comparison with test and validation

This commit is contained in:
Peter Cottle 2014-02-27 11:32:11 -08:00
parent 0be3577572
commit 43579378e8
5 changed files with 47 additions and 8 deletions

View file

@ -618,6 +618,14 @@ GitEngine.prototype.validateBranchName = function(name) {
)
});
}
if (/^[cC]\d+$/.test(name)) {
throw new GitError({
msg: intl.str(
'bad-branch-name',
{ branch: name }
)
});
}
if (/[hH][eE][aA][dD]/.test(name)) {
throw new GitError({
msg: intl.str(
@ -644,7 +652,7 @@ GitEngine.prototype.validateAndMakeBranch = function(id, target) {
throw new GitError({
msg: intl.str(
'bad-branch-name',
{ branch: name }
{ branch: id }
)
});
}