diff --git a/git/git.go b/git/git.go index f985c60..fadf380 100644 --- a/git/git.go +++ b/git/git.go @@ -1,7 +1,5 @@ package git -const gitBin = "/usr/bin/git" - type Author struct { Name string Email string @@ -24,3 +22,5 @@ type Repository struct { Author Author } + +const gitBin = "/usr/bin/git" diff --git a/plugin/impl.go b/plugin/impl.go index 1911451..fcd7cbd 100644 --- a/plugin/impl.go +++ b/plugin/impl.go @@ -46,15 +46,14 @@ func (p *Plugin) run(ctx context.Context) error { func (p *Plugin) Validate() error { var err error - if p.Settings.Repo.WorkDir == "" { - p.Settings.Repo.WorkDir, err = os.Getwd() - } - p.Settings.Repo.Autocorrect = "never" p.Settings.Repo.RemoteName = "origin" - if err != nil { - return fmt.Errorf("failed to get working directory: %w", err) + if p.Settings.Repo.WorkDir == "" { + p.Settings.Repo.WorkDir, err = os.Getwd() + if err != nil { + return fmt.Errorf("failed to get working directory: %w", err) + } } for _, actionStr := range p.Settings.Action.Value() {