mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 15:38:33 +02:00
Resolves #164 case insensitive branch comparison with test and validation
This commit is contained in:
parent
0be3577572
commit
43579378e8
5 changed files with 47 additions and 8 deletions
|
@ -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 }
|
||||
)
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue