Skip to content

Commit 03c927c

Browse files
committed
fix compiler errors
1 parent aa26301 commit 03c927c

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

repo_blob.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,26 @@
44

55
package git
66

7+
import "time"
8+
9+
// CatFileBlobOptions contains optional arguments for verifying the objects.
10+
//
11+
// Docs: https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt
12+
type CatFileBlobOptions struct {
13+
// The timeout duration before giving up for each shell command execution.
14+
// The default timeout duration will be used when not supplied.
15+
Timeout time.Duration
16+
// The additional options to be passed to the underlying git.
17+
CommandOptions
18+
}
19+
720
// CatFileBlob returns the blob corresponding to the given revision of the repository.
8-
func (r *Repository) CatFileBlob(rev string) (*Blob, error) {
21+
func (r *Repository) CatFileBlob(rev string, opts ...CatFileBlobOptions) (*Blob, error) {
22+
var opt CatFileBlobOptions
23+
if len(opts) > 0 {
24+
opt = opts[0]
25+
}
26+
927
rev, err := r.RevParse(rev, RevParseOptions{Timeout: opt.Timeout}) //nolint
1028
if err != nil {
1129
return nil, err

0 commit comments

Comments
 (0)