Skip to content

Commit 5dba206

Browse files
authored
Merge branch 'main' into pnpm
2 parents c54c8cd + 08a7e65 commit 5dba206

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

services/asymkey/sign.go

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,16 +290,22 @@ Loop:
290290
return false, nil, nil, err
291291
}
292292
defer gitRepo.Close()
293-
commit, err := gitRepo.GetCommit(parentCommit)
293+
isEmpty, err := gitRepo.IsEmpty()
294294
if err != nil {
295295
return false, nil, nil, err
296296
}
297-
if commit.Signature == nil {
298-
return false, nil, nil, &ErrWontSign{parentSigned}
299-
}
300-
verification := ParseCommitWithSignature(ctx, commit)
301-
if !verification.Verified {
302-
return false, nil, nil, &ErrWontSign{parentSigned}
297+
if !isEmpty {
298+
commit, err := gitRepo.GetCommit(parentCommit)
299+
if err != nil {
300+
return false, nil, nil, err
301+
}
302+
if commit.Signature == nil {
303+
return false, nil, nil, &ErrWontSign{parentSigned}
304+
}
305+
verification := ParseCommitWithSignature(ctx, commit)
306+
if !verification.Verified {
307+
return false, nil, nil, &ErrWontSign{parentSigned}
308+
}
303309
}
304310
}
305311
}

services/lfs/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func DownloadHandler(ctx *context.Context) {
114114
}
115115
}
116116

117-
ctx.Resp.Header().Set("Content-Range", fmt.Sprintf("bytes %d-%d/%d", fromByte, toByte, meta.Size-fromByte))
117+
ctx.Resp.Header().Set("Content-Range", fmt.Sprintf("bytes %d-%d/%d", fromByte, toByte, meta.Size))
118118
ctx.Resp.Header().Set("Access-Control-Expose-Headers", "Content-Range")
119119
}
120120
}

0 commit comments

Comments
 (0)