Skip to content

Commit 03d62cb

Browse files
authored
fix: typo in struct AddOptions (#87)
Fixes #65
1 parent 05ebee1 commit 03d62cb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

repo.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ type AddOptions struct {
388388
// Indicates whether to add all changes to index.
389389
All bool
390390
// The specific pathspecs to be added to index.
391-
Pathsepcs []string
391+
Pathspecs []string
392392
// The timeout duration before giving up for each shell command execution. The
393393
// default timeout duration will be used when not supplied.
394394
Timeout time.Duration
@@ -407,9 +407,9 @@ func Add(repoPath string, opts ...AddOptions) error {
407407
if opt.All {
408408
cmd.AddArgs("--all")
409409
}
410-
if len(opt.Pathsepcs) > 0 {
410+
if len(opt.Pathspecs) > 0 {
411411
cmd.AddArgs("--")
412-
cmd.AddArgs(opt.Pathsepcs...)
412+
cmd.AddArgs(opt.Pathspecs...)
413413
}
414414
_, err := cmd.RunInDirWithTimeout(opt.Timeout, repoPath)
415415
return err

repo_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ func TestRepository_Add(t *testing.T) {
328328
// Make sure it does not blow up
329329
if err := r.Add(AddOptions{
330330
All: true,
331-
Pathsepcs: []string{"TESTFILE"},
331+
Pathspecs: []string{"TESTFILE"},
332332
}); err != nil {
333333
t.Fatal(err)
334334
}

0 commit comments

Comments
 (0)