From 1f09051f2b0893933ec4cd9fccbb6137e7e9df89 Mon Sep 17 00:00:00 2001
From: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
Date: Fri, 24 Feb 2023 05:50:33 +0800
Subject: [PATCH] Fix SyncOnCommit always return false in API of push_mirrors
 (#23088)

Fix: #22990

---
Before, the return value of the api is always false,regrardless of
whether the entry of `sync_on_commit` is true or false.
I have confirmed that the value of `sync_on_commit` dropped into the
database is correct.
So, I think it is enough to make some small changes.
---
 services/convert/mirror.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/services/convert/mirror.go b/services/convert/mirror.go
index 1dcfc9b64d..f7a8e17fd0 100644
--- a/services/convert/mirror.go
+++ b/services/convert/mirror.go
@@ -24,6 +24,7 @@ func ToPushMirror(pm *repo_model.PushMirror) (*api.PushMirror, error) {
 		LastUpdateUnix: pm.LastUpdateUnix.FormatLong(),
 		LastError:      pm.LastError,
 		Interval:       pm.Interval.String(),
+		SyncOnCommit:   pm.SyncOnCommit,
 	}, nil
 }