diff --git a/__tests__/git.spec.js b/__tests__/git.spec.js index 656d197e..6b7c8ece 100644 --- a/__tests__/git.spec.js +++ b/__tests__/git.spec.js @@ -142,6 +142,13 @@ describe('Git', function() { ); }); + it('Range operator is not supported', function() { + expectTreeAsync( + 'git checkout -b side C0; git cherry-pick C1..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":{"id": "HEAD","target":"side"}}' + ); + }); + it('Forces branches', function() { expectTreeAsync( 'git checkout -b side; git branch -f side C0', diff --git a/src/js/git/index.js b/src/js/git/index.js index d03a2075..dcac6ea9 100644 --- a/src/js/git/index.js +++ b/src/js/git/index.js @@ -1665,7 +1665,7 @@ GitEngine.prototype.resolveStringRef = function(ref) { // Attempt to split ref string into a reference and a string of ~ and ^ modifiers. var startRef = null; var relative = null; - var regex = /^([a-zA-Z0-9]+)(([~\^]\d*)*)/; + var regex = /^([a-zA-Z0-9]+)(([~\^]\d*)*)$/; var matches = regex.exec(ref); if (matches) { startRef = matches[1];