Skip to content

Commit 852aeef

Browse files
authored
Fix commit between two commits calculation if there is only last commit (#10225)
1 parent 26eaebf commit 852aeef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/git/repo_commit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ func (repo *Repository) CommitsBetween(last *Commit, before *Commit) (*list.List
319319
var stdout []byte
320320
var err error
321321
if before == nil {
322-
stdout, err = NewCommand("rev-list", before.ID.String()).RunInDirBytes(repo.Path)
322+
stdout, err = NewCommand("rev-list", last.ID.String()).RunInDirBytes(repo.Path)
323323
} else {
324324
stdout, err = NewCommand("rev-list", before.ID.String()+"..."+last.ID.String()).RunInDirBytes(repo.Path)
325325
}

0 commit comments

Comments
 (0)