tangled
alpha
login
or
join now
veryroundbird.house
/
core
forked from
tangled.org/core
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
knotserver: git: fix hiddenRef logic
anirudh.fi
11 months ago
d6b7f6e6
5959c27f
verified
This commit was signed with the committer's
known signature
.
anirudh.fi
SSH Key Fingerprint:
SHA256:cz35vdbiWEzCNEfuL9fMC2JVIhtXavXBHrRjv8gxpAk=
+5
-2
1 changed file
expand all
collapse all
unified
split
knotserver
git
fork.go
+5
-2
knotserver/git/fork.go
···
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