jenkins fatal: ambiguous argument, unknown revision or path not in the working tree
From the git documentation around the command git rev-list: 

git rev-list A...B

Try your command syntax like the above (i.e. origin/master...origin/${currentBranch})