Skip to content

Commit

Permalink
feat(base-branch): add base branch parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
davinkevin committed Jul 22, 2024
1 parent 396864d commit 3b7152c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ type UserConfig struct {
StatusBitsHeader bool `default:"true" yaml:"statusBitsHeader"`
StatusBitsEmojis bool `default:"true" yaml:"statusBitsEmojis"`

CreateDraftPRs bool `default:"false" yaml:"createDraftPRs"`
PreserveTitleAndBody bool `default:"false" yaml:"preserveTitleAndBody"`
NoRebase bool `default:"false" yaml:"noRebase"`
CreateDraftPRs bool `default:"false" yaml:"createDraftPRs"`
PreserveTitleAndBody bool `default:"false" yaml:"preserveTitleAndBody"`
NoRebase bool `default:"false" yaml:"noRebase"`
BranchPrefix string `default:"spr" yaml:"branchPrefix"`
}

type InternalState struct {
Expand Down
3 changes: 2 additions & 1 deletion git/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ func GetLocalBranchName(gitcmd GitInterface) string {

func BranchNameFromCommit(cfg *config.Config, commit Commit) string {
remoteBranchName := cfg.Repo.GitHubBranch
return "spr/" + remoteBranchName + "/" + commit.CommitID
branchPrefix := cfg.User.BranchPrefix
return branchPrefix + "/" + remoteBranchName + "/" + commit.CommitID
}

var BranchNameRegex = regexp.MustCompile(`spr/([a-zA-Z0-9_\-/\.]+)/([a-f0-9]{8})$`)
Expand Down

0 comments on commit 3b7152c

Please sign in to comment.