Skip to content

Commit 9f027fa

Browse files
committed
Fix a bug that occurred when a merge commit is specified
An unnecessary commit would be touched when the left bound of a commit range was a merge commit.
1 parent d598c0e commit 9f027fa

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎git-shift‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,11 @@ sub expand_revspec {
258258
if ($to_spec eq '') {
259259
$to_spec = 'HEAD';
260260
}
261-
return git_revlist($from_spec eq '' ?
262-
$to_spec :
263-
sprintf('%s^..%s', $from_spec, $to_spec));
261+
my @revs = git_revlist($from_spec eq '' ?
262+
$to_spec :
263+
sprintf('%s..%s', $from_spec, $to_spec));
264+
push @revs, git_revparse($from_spec) unless $from_spec eq '';
265+
return @revs;
264266
}
265267

266268
my @revs = (git_revparse($revspec));

0 commit comments

Comments
 (0)