Skip to content

Consolidate git config helpers in internal/git #127

Description

@andrew

#109 added storePRForBranch / loadPRForBranch in internal/cli/pr.go, which call git config inline via exec.CommandContext. #118 added internal/git with runGit and SetBaseBranch doing the same kind of thing.

Move the branch.<name>.forge-pr read/write into internal/git alongside SetBaseBranch (e.g. SetPRNumber / GetPRNumber), and route pr.go through them. That keeps the branch.<name>.* key format in one place and removes the last direct exec git-config calls from the CLI layer.

While in there, findPRForCurrentBranch and GetOrFetchBaseBranch both shell out for git branch --show-current; that could become a single git.CurrentBranch(ctx, dir) helper too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions