Skip to content

Commit

Permalink
fix(mirror): skip LFS instead of failing to mirror a repo
Browse files Browse the repository at this point in the history
If an LFS client can't be created because it's not compatible for
some reason, skip it entirely for a mirrored repo. This prevents one
possible crash when mirroring fails. It still seems to crash when
accessing user info, so something is still missing. Either way, it
seems valid to skip LFS if it just won't work.
  • Loading branch information
nilium authored and aymanbagabas committed Jul 31, 2024
1 parent 59e83d9 commit 07076f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/backend/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ func (d *Backend) ImportRepository(_ context.Context, name string, user proto.Us

client := lfs.NewClient(ep)
if client == nil {
return fmt.Errorf("failed to create lfs client: unsupported endpoint %s", endpoint)
d.logger.Warn("failed to create lfs client: unsupported endpoint", "endpoint", endpoint)
return nil
}

if err := StoreRepoMissingLFSObjects(ctx, r, d.db, d.store, client); err != nil {
Expand Down

0 comments on commit 07076f8

Please sign in to comment.