mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-30 04:10:32 +00:00
On Repo update, keep old "Clone" if update would empty it (#1170)
fixed #1169 after debugging, I found that: if `Clone` in database is empty, before https://github.com/woodpecker-ci/woodpecker/blob/master/server/api/hook.go#L128, the `repo.Clone` be always unset, so clone is failed. This PR makes the empty `Clone` can't overwrite the value in database.
This commit is contained in:
parent
876cbce0f5
commit
eaf05dbae8
1 changed files with 3 additions and 1 deletions
|
@ -82,7 +82,9 @@ func (r *Repo) Update(from *Repo) {
|
||||||
r.Avatar = from.Avatar
|
r.Avatar = from.Avatar
|
||||||
r.Link = from.Link
|
r.Link = from.Link
|
||||||
r.SCMKind = from.SCMKind
|
r.SCMKind = from.SCMKind
|
||||||
r.Clone = from.Clone
|
if len(from.Clone) > 0 {
|
||||||
|
r.Clone = from.Clone
|
||||||
|
}
|
||||||
r.Branch = from.Branch
|
r.Branch = from.Branch
|
||||||
if from.IsSCMPrivate != r.IsSCMPrivate {
|
if from.IsSCMPrivate != r.IsSCMPrivate {
|
||||||
if from.IsSCMPrivate {
|
if from.IsSCMPrivate {
|
||||||
|
|
Loading…
Reference in a new issue