diff --git a/repo.go b/repo.go index effebcf8..e53327d7 100644 --- a/repo.go +++ b/repo.go @@ -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 @@ -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 diff --git a/repo_test.go b/repo_test.go index 87015c04..7f4ef1c4 100644 --- a/repo_test.go +++ b/repo_test.go @@ -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) }