Skip to content

Commit b4eb943

Browse files
committed
Handle lfs url config using inline configuration
- remove .lfsconfig dependency
1 parent a549c79 commit b4eb943

File tree

4 files changed

+6
-127
lines changed

4 files changed

+6
-127
lines changed

cmd/git-gitopia/lfs/init.go

Lines changed: 0 additions & 107 deletions
This file was deleted.

cmd/git-gitopia/lfs/root.go

Lines changed: 0 additions & 18 deletions
This file was deleted.

cmd/git-gitopia/root.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package main
22

33
import (
44
"github.com/cosmos/cosmos-sdk/client/keys"
5-
"github.com/gitopia/git-remote-gitopia/cmd/git-gitopia/lfs"
65
"github.com/gitopia/gitopia-go"
76
"github.com/spf13/cobra"
87
)
@@ -16,7 +15,6 @@ func RootCommand() *cobra.Command {
1615
},
1716
}
1817
cmd.AddCommand(keys.Commands("."))
19-
cmd.AddCommand(lfs.Commands())
2018

2119
return cmd
2220
}

cmd/git-remote-gitopia/gitopia.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,11 @@ func (h *GitopiaHandler) Fetch(remote *core.Remote, refsToFetch []core.RefToFetc
153153
return err
154154
}
155155
remoteURL := fmt.Sprintf("%v/%v.git", gitServerHost, h.remoteRepository.Id)
156+
lfsURL := remoteURL // Use same URL for LFS
156157

157158
if !remote.Force {
158159
args := []string{
160+
"-c", fmt.Sprintf("lfs.url=%s", lfsURL),
159161
"fetch",
160162
"--no-write-fetch-head",
161163
remoteURL,
@@ -179,6 +181,7 @@ func (h *GitopiaHandler) Fetch(remote *core.Remote, refsToFetch []core.RefToFetc
179181
}
180182

181183
args := []string{
184+
"-c", fmt.Sprintf("lfs.url=%s", lfsURL),
182185
"fetch",
183186
"--no-write-fetch-head",
184187
remoteURL,
@@ -233,6 +236,7 @@ func (h *GitopiaHandler) Push(remote *core.Remote, refsToPush []core.RefToPush)
233236
return nil, err
234237
}
235238
remoteURL := fmt.Sprintf("%v/%v.git", gitServerHost, h.remoteRepository.Id)
239+
lfsURL := remoteURL // Use same URL for LFS
236240

237241
var newRemoteRefSha string
238242
var setBranches []gitopiatypes.MsgMultiSetBranch_Branch
@@ -285,6 +289,8 @@ func (h *GitopiaHandler) Push(remote *core.Remote, refsToPush []core.RefToPush)
285289
"credential.helper=",
286290
"-c",
287291
"credential.helper=gitopia",
292+
"-c",
293+
fmt.Sprintf("lfs.url=%s", lfsURL),
288294
"push",
289295
remoteURL,
290296
fmt.Sprintf("%s:%s", ref.Local, ref.Remote),

0 commit comments

Comments
 (0)