diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2024-03-11 05:30:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-10 22:30:36 +0100 |
commit | 3c6fc25a77c37d50686caa495d27a31dcef7f75f (patch) | |
tree | baee1d20d877cdfcf6c65e6784068ea86c85e17b /services/mirror/mirror_pull.go | |
parent | 851bd18234ff3de4c603c57c3b380eb5495d8eb7 (diff) | |
download | gitea-3c6fc25a77c37d50686caa495d27a31dcef7f75f.tar.gz gitea-3c6fc25a77c37d50686caa495d27a31dcef7f75f.zip |
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.
Diffstat (limited to 'services/mirror/mirror_pull.go')
-rw-r--r-- | services/mirror/mirror_pull.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/services/mirror/mirror_pull.go b/services/mirror/mirror_pull.go index de4a58f27b..2a38d4ba55 100644 --- a/services/mirror/mirror_pull.go +++ b/services/mirror/mirror_pull.go @@ -479,10 +479,7 @@ func SyncPullMirror(ctx context.Context, repoID int64) bool { log.Error("SyncMirrors [repo: %-v]: unable to GetRefCommitID [ref_name: %s]: %v", m.Repo, result.refName, err) continue } - objectFormat, err := git.GetObjectFormatOfRepo(ctx, m.Repo.RepoPath()) - if err != nil { - log.Error("SyncMirrors [repo: %-v]: unable to GetHashTypeOfRepo: %v", m.Repo, err) - } + objectFormat := git.ObjectFormatFromName(m.Repo.ObjectFormatName) notify_service.SyncPushCommits(ctx, m.Repo.MustOwner(ctx), m.Repo, &repo_module.PushUpdateOptions{ RefFullName: result.refName, OldCommitID: objectFormat.EmptyObjectID().String(), |