Skip to content

Commit d0707d8

Browse files
committed
Enhance output of git lfs push
1 parent 77436f1 commit d0707d8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

component/git_http.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,12 @@ func (c *gitHTTPComponentImpl) lfsBatchUploadInfo(ctx context.Context, req types
281281
Actions: map[string]*types.Link{},
282282
Pointer: obj,
283283
}
284+
284285
if largeFileWithoutMultipart(req, obj) {
285-
return nil, errors.New("You need to configure your repository to enable upload of files > 5GB.\nRun \"csghub-sdk lfs-enable-largefiles ./path/to/your/repo\" and try again.")
286+
resp.Error = &types.ObjectError{
287+
Code: http.StatusUnprocessableEntity,
288+
Message: "Please use csghub-sdk to upload files > 5GB.\n",
289+
}
286290
}
287291

288292
if useMultipart {

component/multi_sync.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ type multiSyncComponentImpl struct {
3636
tagStore database.TagStore
3737
fileStore database.FileStore
3838
gitServer gitserver.GitServer
39+
config *config.Config
3940
}
4041

4142
type MultiSyncComponent interface {
@@ -63,6 +64,7 @@ func NewMultiSyncComponent(config *config.Config) (MultiSyncComponent, error) {
6364
promptStore: database.NewPromptStore(),
6465
mcpStore: database.NewMCPServerStore(),
6566
gitServer: git,
67+
config: config,
6668
}, nil
6769
}
6870

@@ -86,6 +88,10 @@ func (c *multiSyncComponentImpl) More(ctx context.Context, cur int64, limit int6
8688
}
8789

8890
func (c *multiSyncComponentImpl) SyncAsClient(ctx context.Context, sc multisync.Client) error {
91+
if !c.config.MultiSync.Enabled {
92+
return nil
93+
}
94+
8995
var currentVersion int64
9096
v, err := c.multiSyncStore.GetLatest(ctx)
9197
if err != nil {

0 commit comments

Comments
 (0)