mirror of
https://github.com/go-gitea/gitea.git
synced 2026-01-21 00:48:07 +00:00
Maybe fix #32018 - Use `gitrepo.GetMergeBase` method instead of other two implementations. - Add `FetchRemoteCommit` so that we don't need to add many `remote` to the git repository to avoid possible git lock conflicts. A lock will start when invoke the function, it will be invoked when cross-repository comparing. The head repository will fetch the base repository's base commit id. In most situations, it should lock the fork repositories so that it should not become a bottleneck. - Improve `GetCompareInfo` to remove unnecessarily adding remote. - Remove unnecessary parameters of `SignMerge`.
11 lines
401 B
Go
11 lines
401 B
Go
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package gitrepo
|
|
|
|
// getRepoWriteLockKey returns the global lock key for write operations on the repository.
|
|
// Parallel write operations on the same git repository should be avoided to prevent data corruption.
|
|
func getRepoWriteLockKey(repoStoragePath string) string {
|
|
return "repo-write:" + repoStoragePath
|
|
}
|