Skip to content

Commit

Permalink
Pass valid config to git amend
Browse files Browse the repository at this point in the history
fixes: #101

commit-id:e0317625
  • Loading branch information
ejoffe committed Oct 1, 2021
1 parent ac0b650 commit 74df668
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .spr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ githubRepoOwner: ejoffe
githubRepoName: spr
requireChecks: true
requireApproval: false
githubRemote: origin
githubBranch: master
8 changes: 5 additions & 3 deletions cmd/amend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ func main() {
os.Exit(0)
}

gitcmd := realgit.NewGitCmd(config.EmptyConfig())

gitcmd := realgit.NewGitCmd(config.DefaultConfig())
// check that we are inside a git dir
var output string
err = gitcmd.Git("status --porcelain", &output)
Expand All @@ -50,8 +49,11 @@ func main() {
os.Exit(2)
}

cfg := config.ParseConfig(gitcmd)
gitcmd = realgit.NewGitCmd(cfg)
ctx := context.Background()
sd := spr.NewStackedPR(nil, nil, gitcmd, os.Stdout)

sd := spr.NewStackedPR(cfg, nil, gitcmd, os.Stdout)
sd.AmendCommit(ctx)
}

Expand Down

0 comments on commit 74df668

Please sign in to comment.