Skip to content

Commit af5d96e

Browse files
gzsomborEarl Warren
authored andcommitted
Do not report warning when git shows new reference (go-gitea#6540)
## Checklist The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org). ### Tests - I added test coverage for Go changes... - [X] in their respective `*_test.go` for unit tests. - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server. - I added test coverage for JavaScript changes... - [ ] in `web_src/js/*.test.js` if it can be unit tested. - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)). ### Documentation - [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. - [X] I did not document these changes and I do not expect someone else to do it. ### Release notes - [x] I do not want this change to show in the release notes. - [ ] I want the title to show in the release notes with a link to this pull request. - [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6540 Reviewed-by: Earl Warren <[email protected]> Co-authored-by: Zsombor Gegesy <[email protected]> Co-committed-by: Zsombor Gegesy <[email protected]>
1 parent 011ac8d commit af5d96e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

services/mirror/mirror_pull.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ func parseRemoteUpdateOutput(output, remoteName string) []*mirrorSyncResult {
174174
newCommitID: shas[1],
175175
})
176176

177+
case strings.HasPrefix(lines[i], " * [new ref]"): // new reference - nothing to do
177178
default:
178179
log.Warn("parseRemoteUpdateOutput: unexpected update line %q", lines[i])
179180
}

services/mirror/mirror_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ func Test_parseRemoteUpdateOutput(t *testing.T) {
1717
- [deleted] (none) -> tag1
1818
+ f895a1e...957a993 test2 -> origin/test2 (forced update)
1919
957a993..a87ba5f test3 -> origin/test3
20-
`
20+
* [new ref] refs/pull/27/merge -> refs/pull/27/merge
21+
* [new ref] refs/pull/516/head -> refs/pull/516/head
22+
`
2123
results := parseRemoteUpdateOutput(output, "origin")
2224
assert.Len(t, results, 6)
2325
assert.EqualValues(t, "refs/tags/v0.1.8", results[0].refName.String())

0 commit comments

Comments
 (0)