Skip to content

Unable to update repository invalid branch name, when branch name is valid. #132

Description

@jnstockley

Hi, I recently switched to forgejo instead of Gitea, and when I was moving my OpenTofu config from Gitea to forgejo, for a few of my repos I ran into this error

│ Error: Unable to update repository
│ 
│   with forgejo_repository.ece-scholarships,
│   on repos.tofu line 209, in resource "forgejo_repository" "ece-scholarships":
│  209: resource "forgejo_repository" "ece-scholarships" {
│ 
│ Unknown error (status 500): exit status 128 - fatal: '' is not a valid branch name
│ hint: See `man git check-ref-format`
│ hint: Disable this message with "git config set advice.refSyntax false"
│  - fatal: '' is not a valid branch name
│ hint: See `man git check-ref-format`
│ hint: Disable this message with "git config set advice.refSyntax false"

Here is the config for the repo in question

resource "forgejo_repository" "ece-scholarships" {
  default_branch  = "main"
  description     = null
  mirror          = true
  clone_addr      = "https://github.com/jnstockley/ECE-Scholarships.git"
  mirror_interval = "8h0m0s"
  has_releases    = true
  service         = "github"
  auth_token      = var.github_token
  name            = "ECE-Scholarships"
  private         = false
  owner           = forgejo_user.jack-stockley.login

  depends_on = [forgejo_user.jack-stockley]
}

the default branch is main. Also when I view the repo in the WebUI I do see it and it seems to be setup correctly which is strange.

Any ideas why this is happening? Thanks for your work on this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdependenciesPull requests that update a dependency filequestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions