Skip to content

Commit

Permalink
Fix handling -A option
Browse files Browse the repository at this point in the history
  • Loading branch information
KacperMalachowski committed Oct 17, 2024
1 parent 0c2e214 commit 7ce2443
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/github/bumper/bumper.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ func processGitHub(o *Options, prh PRHandler) error {
// }

for _, file := range filesToBeAdded {
if file == "-A" {
workTree.AddWithOptions(&git.AddOptions{All: true})
continue
}
if _, err := workTree.Add(file); err != nil {
return fmt.Errorf("add file %s to the worktree: %w", file, err)
}
Expand All @@ -370,8 +374,6 @@ func processGitHub(o *Options, prh PRHandler) error {
// }
}

gitRepo.Fetch(&git.FetchOptions{})

remote := fmt.Sprintf("https://%s:%s@%s/%s/%s.git", o.GitHubLogin, string(secret.GetTokenGenerator(o.GitHubToken)()), githubHost, o.GitHubLogin, o.RemoteName)
if err := gitPush(remote, o.HeadBranchName, stdout, stderr, o.SkipPullRequest); err != nil {
return fmt.Errorf("push changes to the remote branch: %w", err)
Expand Down

0 comments on commit 7ce2443

Please sign in to comment.