alpha
Login
or
Join now
4uffin.bsky.social
/
core
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
My own copy of Tangled :)
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
knotserver: git: fix hiddenRef logic
author
Anirudh Oppiliappan
date
1 year ago
(Apr 4, 2025, 8:54 PM +0300)
commit
d6b7f6e6
d6b7f6e61fbd5aeb10680956fbd8c31ae55f5ecd
parent
5959c27f
5959c27ff3ffe9e6a925bb753328dc99fc0dc265
+5
-2
1 changed file
Expand all
Collapse all
Unified
Split
knotserver
git
fork.go
+5
-2
knotserver/git/fork.go
Reviewed
···
1
1
package git
2
2
3
3
import (
4
4
+
"errors"
4
5
"fmt"
5
6
"os/exec"
6
7
···
34
35
func (g *GitRepo) TrackHiddenRemoteRef(forkRef, remoteRef string) error {
35
36
fetchOpts := &git.FetchOptions{
36
37
RefSpecs: []config.RefSpec{
37
37
-
config.RefSpec(fmt.Sprintf("+refs/heads/%s:refs/hidden/%s/%s", forkRef, forkRef, remoteRef)),
38
38
+
config.RefSpec(fmt.Sprintf("+refs/heads/%s:refs/hidden/%s/%s", remoteRef, forkRef, remoteRef)),
38
39
},
39
40
RemoteName: "origin",
40
41
}
41
42
42
43
err := g.r.Fetch(fetchOpts)
43
43
-
if err != nil {
44
44
+
if errors.Is(git.NoErrAlreadyUpToDate, err) {
45
45
+
return nil
46
46
+
} else if err != nil {
44
47
return fmt.Errorf("failed to fetch hidden remote: %s: %w", forkRef, err)
45
48
}
46
49
return nil