1
0
Fork 0
forked from forgejo/forgejo

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.

(cherry picked from commit 3c6fc25a77c37d50686caa495d27a31dcef7f75f)

Conflicts:
	services/pull/pull.go
This commit is contained in:
Lunny Xiao 2024-03-11 05:30:36 +08:00 committed by Earl Warren
parent 32dd02829e
commit 69ebc2f7d8
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
6 changed files with 9 additions and 29 deletions

View file

@ -351,7 +351,7 @@ func TestPullRequest(ctx context.Context, doer *user_model.User, repoID, maxPR i
}
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 {