diff --git a/services/mirror/mirror_pull.go b/services/mirror/mirror_pull.go index 2d128919f9..53a2cff13f 100644 --- a/services/mirror/mirror_pull.go +++ b/services/mirror/mirror_pull.go @@ -174,6 +174,7 @@ func parseRemoteUpdateOutput(output, remoteName string) []*mirrorSyncResult { newCommitID: shas[1], }) + case strings.HasPrefix(lines[i], " * [new ref]"): // new reference - nothing to do default: log.Warn("parseRemoteUpdateOutput: unexpected update line %q", lines[i]) } diff --git a/services/mirror/mirror_test.go b/services/mirror/mirror_test.go index 8ad524b608..860470522e 100644 --- a/services/mirror/mirror_test.go +++ b/services/mirror/mirror_test.go @@ -17,7 +17,9 @@ func Test_parseRemoteUpdateOutput(t *testing.T) { - [deleted] (none) -> tag1 + f895a1e...957a993 test2 -> origin/test2 (forced update) 957a993..a87ba5f test3 -> origin/test3 -` + * [new ref] refs/pull/27/merge -> refs/pull/27/merge + * [new ref] refs/pull/516/head -> refs/pull/516/head + ` results := parseRemoteUpdateOutput(output, "origin") assert.Len(t, results, 6) assert.EqualValues(t, "refs/tags/v0.1.8", results[0].refName.String())