Skip to content

Commit baf6981

Browse files
committed
Fix clone of lfs repository
1 parent b4eb943 commit baf6981

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cmd/git-remote-gitopia/gitopia.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ func (h *GitopiaHandler) Initialize(remote *core.Remote) error {
7878
}
7979
}
8080

81+
remote.Logger.Printf("grpc host: %s", grpcHost)
82+
remote.Logger.Printf("rpc host: %s", tmAddr)
83+
remote.Logger.Printf("git server host: %s", gitServerHost)
84+
8185
h.grpcConn, err = grpc.Dial(grpcHost, grpc.WithTransportCredentials(insecure.NewCredentials()))
8286
if err != nil {
8387
return err
@@ -108,6 +112,14 @@ func (h *GitopiaHandler) Initialize(remote *core.Remote) error {
108112

109113
h.remoteRepository = *res.Repository
110114

115+
// Configure LFS URL for clone operations to avoid SSH to non-existent "gitopia" hostname
116+
lfsURL := fmt.Sprintf("%v/%v.git", gitServerHost, h.remoteRepository.Id)
117+
cmd := core.GitCommand("git", "config", "--local", "lfs.url", lfsURL)
118+
if err := cmd.Run(); err != nil {
119+
// Log but don't fail if LFS config fails (repo might not have LFS)
120+
remote.Logger.Printf("Warning: could not configure LFS URL: %v", err)
121+
}
122+
111123
return nil
112124
}
113125

0 commit comments

Comments
 (0)