From 3c6fc25a77c37d50686caa495d27a31dcef7f75f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 11 Mar 2024 05:30:36 +0800 Subject: Use repo object format name instead of detecting from git repository (#29702) It's unnecessary to detect the repository object format from git repository. Just use the repository's object format name. --- services/pull/pull.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/pull') diff --git a/services/pull/pull.go b/services/pull/pull.go index be3d25d20a..9133a72acf 100644 --- a/services/pull/pull.go +++ b/services/pull/pull.go @@ -337,7 +337,7 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string, } if err == nil { for _, pr := range prs { - objectFormat, _ := git.GetObjectFormatOfRepo(ctx, pr.BaseRepo.RepoPath()) + objectFormat := git.ObjectFormatFromName(pr.BaseRepo.ObjectFormatName) if newCommitID != "" && newCommitID != objectFormat.EmptyObjectID().String() { changed, err := checkIfPRContentChanged(ctx, pr, oldCommitID, newCommitID) if err != nil { -- cgit v1.2.3