From 3083b6f6ad5f102e42310ed85db7c259b3bb9205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauris=20Buk=C5=A1is-Haberkorns?= Date: Tue, 11 Feb 2020 00:34:14 +0200 Subject: [PATCH] Fix commit between two commits calculation if there is only last commit --- 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 1f211aaca2191..d20c6540eb535 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) }