Skip to content

fix: typo in struct AddOptions #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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