Skip to content

Commit a9633fd

Browse files
committed
follow wxiaoguang's suggestion
1 parent 38c19d2 commit a9633fd

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

services/mirror/mirror_pull.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -365,25 +365,6 @@ func runSync(ctx context.Context, m *repo_model.Mirror) ([]*mirrorSyncResult, bo
365365
stderrBuilder.Reset()
366366
stdoutBuilder.Reset()
367367

368-
// Verify that the remote exists before running `git remote update --prune`.
369-
// Without this check, the command will not fail if the remote is missing;
370-
// it will appear to succeed silently, even though nothing was updated.
371-
_, err := gitrepo.GitRemoteGetURL(ctx, m.Repo.WikiStorageRepo(), m.GetRemoteName())
372-
if err != nil {
373-
log.Error("SyncMirrors [repo: %-v Wiki]: GetRemoteURL Error %v", m.Repo, err)
374-
return nil, false
375-
}
376-
377-
fetchConfig, err := gitrepo.GitConfigGet(ctx, m.Repo.WikiStorageRepo(), "remote.origin.fetch")
378-
if err != nil {
379-
log.Error("SyncMirrors [repo: %-v Wiki]: GetGitConfig Error %v", m.Repo, err)
380-
return nil, false
381-
}
382-
if fetchConfig == "" {
383-
log.Error("remote %s has no fetch config for repository %s", m.GetRemoteName(), m.Repo.WikiStorageRepo().RelativePath())
384-
return nil, false
385-
}
386-
387368
if err := gitrepo.GitRemoteUpdatePrune(ctx, m.Repo.WikiStorageRepo(), m.GetRemoteName(),
388369
timeout, &stdoutBuilder, &stderrBuilder); err != nil {
389370
stdout := stdoutBuilder.String()

0 commit comments

Comments
 (0)