From 0198bbedc193fd1c5733fede11a57b7900cf6c8c Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 12 May 2020 06:52:46 +0100 Subject: Allow compare page to look up base, head, own-fork, forkbase-of-head (#11327) * Allow compare page to look up base, head, own-fork, forkbase-of-head Signed-off-by: Andrew Thornton * as per @guillep2k Signed-off-by: Andrew Thornton * Update routers/repo/compare.go * as per @guillep2k Signed-off-by: Andrew Thornton * Rationalise the names a little Signed-off-by: Andrew Thornton * Rationalise the names a little (2) Signed-off-by: Andrew Thornton * Fix 500 with fork of fork Signed-off-by: Andrew Thornton * Prevent 500 on compare different trees Signed-off-by: Andrew Thornton * dotdotdot is perfectly valid in both usernames and repo names Signed-off-by: Andrew Thornton * ensure we can set the head and base repos too Signed-off-by: Andrew Thornton * ensure we can set the head and base repos too (2) Signed-off-by: Andrew Thornton * fix lint Signed-off-by: Andrew Thornton * only set headRepo == baseRepo if isSameRepo Signed-off-by: Andrew Thornton --- modules/git/commit.go | 4 ---- 1 file changed, 4 deletions(-) (limited to 'modules/git/commit.go') diff --git a/modules/git/commit.go b/modules/git/commit.go index e65782912f..5e492e27ea 100644 --- a/modules/git/commit.go +++ b/modules/git/commit.go @@ -529,10 +529,6 @@ func GetCommitFileStatus(repoPath, commitID string) (*CommitFileStatus, error) { // GetFullCommitID returns full length (40) of commit ID by given short SHA in a repository. func GetFullCommitID(repoPath, shortID string) (string, error) { - if len(shortID) >= 40 { - return shortID, nil - } - commitID, err := NewCommand("rev-parse", shortID).RunInDir(repoPath) if err != nil { if strings.Contains(err.Error(), "exit status 128") { -- cgit v1.2.3