From 852aeeffc0a9902e75cd599d5a4fb706e56dcef7 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Tue, 11 Feb 2020 01:04:43 +0200 Subject: [PATCH] Fix commit between two commits calculation if there is only last commit (#10225) --- modules/git/repo_commit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/git/repo_commit.go b/modules/git/repo_commit.go index 1f211aaca219..d20c6540eb53 100644 --- a/modules/git/repo_commit.go +++ b/modules/git/repo_commit.go @@ -319,7 +319,7 @@ func (repo *Repository) CommitsBetween(last *Commit, before *Commit) (*list.List var stdout []byte var err error if before == nil { - stdout, err = NewCommand("rev-list", before.ID.String()).RunInDirBytes(repo.Path) + stdout, err = NewCommand("rev-list", last.ID.String()).RunInDirBytes(repo.Path) } else { stdout, err = NewCommand("rev-list", before.ID.String()+"..."+last.ID.String()).RunInDirBytes(repo.Path) }