Skip to content

api: update contents on existing target branch - #8365

Open
ifer47 wants to merge 1 commit into
gogs:mainfrom
ifer47:fix-api-put-existing-branch-v2
Open

api: update contents on existing target branch#8365
ifer47 wants to merge 1 commit into
gogs:mainfrom
ifer47:fix-api-put-existing-branch-v2

Conversation

@ifer47

@ifer47 ifer47 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Describe the pull request

The contents API treats the request branch as the target branch. When that target branch already exists and is not the default branch, a second PUT currently passes it as NewBranch from the default branch and fails with branch already exists. This updates the branch selection so existing target branches are updated in place, while missing target branches are still created from the default branch.

Link to the issue: #8189

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code or have provided the test plan. (if applicable)
  • I have added an entry to CHANGELOG. (if applicable)

Test plan

  • go test ./internal/route/api/v1

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant