Skip to content

Commit

Permalink
fix: typo in struct AddOptions
Browse files Browse the repository at this point in the history
fixes #65
  • Loading branch information
bjschafer committed Nov 22, 2022
1 parent 58d9f16 commit 065ee78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ type AddOptions struct {
// Indicates whether to add all changes to index.
All bool
// The specific pathspecs to be added to index.
Pathsepcs []string
Pathspecs []string
// The timeout duration before giving up for each shell command execution. The
// default timeout duration will be used when not supplied.
Timeout time.Duration
Expand All @@ -407,9 +407,9 @@ func Add(repoPath string, opts ...AddOptions) error {
if opt.All {
cmd.AddArgs("--all")
}
if len(opt.Pathsepcs) > 0 {
if len(opt.Pathspecs) > 0 {
cmd.AddArgs("--")
cmd.AddArgs(opt.Pathsepcs...)
cmd.AddArgs(opt.Pathspecs...)
}
_, err := cmd.RunInDirWithTimeout(opt.Timeout, repoPath)
return err
Expand Down
2 changes: 1 addition & 1 deletion repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func TestRepository_Add(t *testing.T) {
// Make sure it does not blow up
if err := r.Add(AddOptions{
All: true,
Pathsepcs: []string{"TESTFILE"},
Pathspecs: []string{"TESTFILE"},
}); err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 065ee78

Please sign in to comment.