Skip to content

git_push() silently succeeds with protected branches, expecting failure #236

Description

@krlmlr

Add a ruleset indicating that a status check must pass, or that PRs are required, for the main branch. Then:

gert::git_push()

info <- gert::git_info()
info$commit
#> [1] "0df1ef7c90ef5d4aa939e0d1aea56ab130d50d17"
gert::git_commit_id(info$upstream)
#> [1] "81680ff5d1608d1f64688e29c2852b41351b8fdb"

Created on 2024-08-18 with reprex v2.1.0

In interactive mode (can't reprex), I'm seeing:

d> gert::git_push()
Trying to authenticate 'git' using ssh-agent...
[status] refs/heads/main: push declined due to repository rule violations

I can work around by checking if <remote>/<branch> is the same as the local branch, but it would be better IMO if git_push() did that for me.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions