aports/testing/tofutf/fix-test-github-client.patch
mio 6507a34299 testing/tofutf: fix test
Adjust `GetArchiveLink` parameter to resolve response error with
`TestGetRepoTarball` test in `internal/github/client_test`. (thanks kdaudt)

```
--- FAIL: TestGetRepoTarball (0.02s)
    client_test.go:57:
          Error Trace:  github.com/tofutf/tofutf/internal/github/client_test.go:57
          Error:        Received unexpected error:
                        unexpected status code: 307 Temporary Redirect
          Test:         TestGetRepoTarball
FAIL
FAIL  github.com/tofutf/tofutf/internal/github  1.068s
```
2026-03-09 14:58:33 +00:00

13 lines
552 B
Diff

diff -rupN a/internal/github/client.go b/internal/github/client.go
--- a/internal/github/client.go 2024-09-14 20:39:16.000000000 +0000
+++ b/internal/github/client.go 2026-03-09 14:34:54.120000000 +0000
@@ -264,7 +264,7 @@ func (g *Client) GetRepoTarball(ctx cont
gopts.Ref = *opts.Ref
}
- link, _, err := g.client.Repositories.GetArchiveLink(ctx, owner, name, github.Tarball, &gopts, true)
+ link, _, err := g.client.Repositories.GetArchiveLink(ctx, owner, name, github.Tarball + "/", &gopts, true)
if err != nil {
return nil, "", err
}