mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-02-23 03:45:47 -05:00
Partial revert "Do not report warning when git shows new reference (#6540)"
This reverts commit af5d96e2cc
.
Except for the test case because
Fix mirror bug (#33224)
implements it now.
This commit is contained in:
parent
574ff84967
commit
6ffa454979
2 changed files with 9 additions and 2 deletions
|
@ -187,7 +187,6 @@ 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])
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ func Test_parseRemoteUpdateOutput(t *testing.T) {
|
|||
* [new ref] refs/pull/516/head -> refs/pull/516/head
|
||||
`
|
||||
results := parseRemoteUpdateOutput(output, "origin")
|
||||
assert.Len(t, results, 6)
|
||||
assert.Len(t, results, 8)
|
||||
assert.EqualValues(t, "refs/tags/v0.1.8", results[0].refName.String())
|
||||
assert.EqualValues(t, gitShortEmptySha, results[0].oldCommitID)
|
||||
assert.EqualValues(t, "", results[0].newCommitID)
|
||||
|
@ -45,4 +45,12 @@ func Test_parseRemoteUpdateOutput(t *testing.T) {
|
|||
assert.EqualValues(t, "refs/heads/test3", results[5].refName.String())
|
||||
assert.EqualValues(t, "957a993", results[5].oldCommitID)
|
||||
assert.EqualValues(t, "a87ba5f", results[5].newCommitID)
|
||||
|
||||
assert.EqualValues(t, "refs/pull/27/merge", results[6].refName.String())
|
||||
assert.EqualValues(t, gitShortEmptySha, results[6].oldCommitID)
|
||||
assert.EqualValues(t, "", results[6].newCommitID)
|
||||
|
||||
assert.EqualValues(t, "refs/pull/516/head", results[7].refName.String())
|
||||
assert.EqualValues(t, gitShortEmptySha, results[7].oldCommitID)
|
||||
assert.EqualValues(t, "", results[7].newCommitID)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue