Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: toyamagu2021 <toyamagu2021@gmail.com>
  • Loading branch information
toyamagu-2021 committed Dec 1, 2024
1 parent c4df94d commit a7d0947
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions reposerver/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -2844,6 +2844,8 @@ func (s *Service) UpdateRevisionForPaths(_ context.Context, request *apiclient.U
defer s.metricsServer.DecPendingRepoRequest(repo.Repo)

// Check if the synced revision is present in the repo. If not, checkout the revision
// Note that fetching with an explicit version can cause repo bloat [https://github.com/argoproj/argo-cd/issues/8845],
// so we should take lock (theoretically not necessary) and checkout.
if !gitClient.IsRevisionPresent(syncedRevision) {
closer, err := s.repoLock.Lock(gitClient.Root(), syncedRevision, true, func() (goio.Closer, error) {
return s.checkoutRevision(gitClient, syncedRevision, false)
Expand Down

0 comments on commit a7d0947

Please sign in to comment.