Skip to content

api: update contents on existing target branch - #8365

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

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

@ifer47
ifer47 requested a review from unknwon as a code owner June 10, 2026 13:34
unknwon added a commit that referenced this pull request Nov 15, 2026
ifer47 found and fixed the same bug in #8365.

Co-authored-by: ifer47 <[email protected]>

unknwon commented Nov 15, 2026

Copy link
Copy Markdown
Member

Thanks @ifer47 for finding and fixing this! The contents API is moving to Flamego in #8454, so the fix landed in #8557, which is stacked on it, and you are credited there as a co-author. Closing this one in favor of #8557.

@unknwon unknwon closed this Nov 15, 2026
unknwon added a commit that referenced this pull request Nov 15, 2026
ifer47 found and fixed the same bug in #8365.

Co-authored-by: ifer47 <[email protected]>
unknwon added a commit that referenced this pull request Nov 15, 2026
ifer47 found and fixed the same bug in #8365.

Co-authored-by: ifer47 <[email protected]>
unknwon added a commit that referenced this pull request Nov 15, 2026
ifer47 found and fixed the same bug in #8365.

Co-authored-by: ifer47 <[email protected]>
unknwon added a commit that referenced this pull request Nov 15, 2026
ifer47 found and fixed the same bug in #8365.

Co-authored-by: ifer47 <[email protected]>
unknwon added a commit that referenced this pull request Nov 15, 2026
ifer47 found and fixed the same bug in #8365.

Co-authored-by: ifer47 <[email protected]>
unknwon added a commit that referenced this pull request Nov 15, 2026
ifer47 found and fixed the same bug in #8365.

Co-authored-by: ifer47 <[email protected]>
unknwon added a commit that referenced this pull request Nov 15, 2026
ifer47 found and fixed the same bug in #8365.

Co-authored-by: ifer47 <[email protected]>
unknwon added a commit that referenced this pull request Nov 15, 2026
ifer47 found and fixed the same bug in #8365.

Co-authored-by: ifer47 <[email protected]>
unknwon added a commit that referenced this pull request Nov 16, 2026
ifer47 found and fixed the same bug in #8365.

Co-authored-by: ifer47 <[email protected]>
unknwon added a commit that referenced this pull request Nov 16, 2026
ifer47 found and fixed the same bug in #8365.

Co-authored-by: ifer47 <[email protected]>
unknwon added a commit that referenced this pull request Nov 16, 2026
ifer47 found and fixed the same bug in #8365.

Co-authored-by: ifer47 <[email protected]>
unknwon added a commit that referenced this pull request Nov 16, 2026
ifer47 found and fixed the same bug in #8365.

Co-authored-by: ifer47 <[email protected]>
unknwon added a commit that referenced this pull request Nov 17, 2026
ifer47 found and fixed the same bug in #8365.

Co-authored-by: ifer47 <[email protected]>
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.

2 participants