handle the ' too

This commit is contained in:
Peter Cottle 2018-09-28 20:35:53 -05:00
parent e8d3bf8667
commit 0e61b0ce5f
2 changed files with 8 additions and 1 deletions

View file

@ -114,6 +114,13 @@ describe('Git', function() {
);
});
it('Branches lowercase', function() {
expectTreeAsync(
'git branch side c0',
'{"branches":{"master":{"target":"C1","id":"master"},"side":{"target":"C0","id":"side"}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"}},"HEAD":{"target":"master","id":"HEAD"}}'
);
});
it('Deletes branches', function() {
expectTreeAsync(
'git branch side; git branch -d side',

View file

@ -1664,7 +1664,7 @@ GitEngine.prototype.resolveStringRef = function(ref) {
return this.refs[ref];
}
// Commit hashes like C4 are case insensitive
if (ref.match(/^c\d+$/) && this.refs[ref.toUpperCase()]) {
if (ref.match(/^c\d+'*/) && this.refs[ref.toUpperCase()]) {
return this.refs[ref.toUpperCase()];
}