mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-07-18 23:47:50 +00:00
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/13443 Fixes #13440. ## Testing Manual testing was performed with an automated reproduction. Attached `main.go` program was used to test go-git interaction with a server using `START_SSH_SERVER = true`. This test app uses go-git to perform an ssh-based push, which replicates the behaviour described in #13440. After dropping main.go into an empty directory, the test app can be run with: ``` go mod init repro go mod tidy REPRO_REPO_URL=ssh://mfenniak@localhost:2222/mfenniak/test.git go run main.go ``` When the fix is **not** present, the database/repository desync warning is shown after running the test command, which indicates that the hooks were interrupted and did not update the database state of the `main` branch:  When this fix **is** present, the database/repository desync warning does not appear, which indicates that the hooks were not interrupted. Repeated test in both modes 3x times to ensure there were no race conditions involved. While it would be possible to incorporate this test into Forgejo's integration testing suite, it would require adding a dependency to `go-git`. As Go doesn't have a concept of test-only dependencies, that would make `go-git` a dependency... which we just recently removed by removing it from Forgejo Runner's jobparser library. It would make `go-git` available for accidental incorporation into Forgejo's code, where it does not behave the same as Forgejo's internal git CLI libraries. Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13451 Reviewed-by: Gusted <gusted@noreply.codeberg.org> |
||
|---|---|---|
| .. | ||
| actions | ||
| activitypub | ||
| analyze | ||
| assetfs | ||
| auth | ||
| avatar | ||
| avatarstore | ||
| base | ||
| cache | ||
| card | ||
| charset | ||
| container | ||
| csv | ||
| emoji | ||
| eventsource | ||
| forgefed | ||
| generate | ||
| git | ||
| gitrepo | ||
| graceful | ||
| hcaptcha | ||
| highlight | ||
| hostmatcher | ||
| html | ||
| httpcache | ||
| httplib | ||
| indexer | ||
| issue/template | ||
| json | ||
| jwtx | ||
| keying | ||
| label | ||
| lfs | ||
| log | ||
| markup | ||
| mcaptcha | ||
| metrics | ||
| migration | ||
| nosql | ||
| optional | ||
| options | ||
| packages | ||
| paginator | ||
| pprof | ||
| private | ||
| process | ||
| proxy | ||
| proxyprotocol | ||
| public | ||
| queue | ||
| recaptcha | ||
| references | ||
| regexplru | ||
| repository | ||
| secret | ||
| session | ||
| setting | ||
| sitemap | ||
| ssh | ||
| storage | ||
| structs | ||
| svg | ||
| sync | ||
| system | ||
| templates | ||
| test | ||
| testimport | ||
| testlogger | ||
| timeutil | ||
| translation | ||
| turnstile | ||
| typesniffer | ||
| updatechecker | ||
| uri | ||
| user | ||
| util | ||
| validation | ||
| web | ||
| webhook | ||
| zstd | ||