Skip to content

Commit

Permalink
fix: empty git-upload-pack given on remote.fetch()
Browse files Browse the repository at this point in the history
More info: This change prevents an attempt to upload pack
when UploadPackRequest is empty.

Partial Resolution: go-git#328

Signed-off-by: Paul Greenberg <greenpau@outlook.com>
  • Loading branch information
greenpau committed Jan 12, 2022
1 parent a5bbcd2 commit 1955d37
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,10 @@ func (r *Remote) fetch(ctx context.Context, o *FetchOptions) (sto storer.Referen
return nil, err
}

if err = r.fetchPack(ctx, o, s, req); err != nil {
return nil, err
if !req.IsEmpty() {
if err = r.fetchPack(ctx, o, s, req); err != nil {
return nil, err
}
}
}

Expand Down

0 comments on commit 1955d37

Please sign in to comment.