Skip to content

Fix git reset --end-of-options error on file upload and edit#8184

Merged
unknwon merged 6 commits intomainfrom
jss/ntcu-fix-git-reset-command-error-option-end-of-options
Feb 19, 2026
Merged

Fix git reset --end-of-options error on file upload and edit#8184
unknwon merged 6 commits intomainfrom
jss/ntcu-fix-git-reset-command-error-option-end-of-options

Conversation

@jss-spector
Copy link
Collaborator

@jss-spector jss-spector commented Feb 18, 2026

Describe the pull request

Bump github.com/gogs/git-module to a version that fixes the incorrect use of --end-of-options in the git reset command. The git reset command does not support --end-of-options, and its inclusion (introduced in git-module v1.8.6) caused fatal: option '--end-of-options' must come before non-option arguments errors when discarding local branch changes. This broke file uploads and edits via the web interface and API for users with Git versions that do not silently ignore the unsupported flag.

The upstream fix (gogs/git-module@6e86531) replaces --end-of-options with -- (double dash) for git reset, which is the correct way to separate options from pathspecs.

Link to the issue: fixes #8183, fixes #8181

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

  1. Start a Gogs instance with the patched dependency.
  2. Create or navigate to a repository.
  3. Edit a file via the web interface and save — confirm the edit succeeds without error.
  4. Upload a file via the web interface — confirm the upload succeeds without error.
  5. Use the API to PUT a file that already exists (update) — confirm it succeeds without error.
  6. Check the server log for any --end-of-options related errors — confirm none appear.

unknwon and others added 2 commits February 18, 2026 17:49
The git reset command does not support the --end-of-options flag, which
was incorrectly added in git-module v1.8.6. This caused "fatal: option
'--end-of-options' must come before non-option arguments" errors when
discarding local repo branch changes.

The updated git-module replaces --end-of-options with -- (double dash)
for git reset, which is the correct way to separate options from
pathspecs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jss-spector jss-spector changed the title [WIP] Fix git reset command error: 'option --end-of-options must co... mod: bump git-module to fix git reset --end-of-options error Feb 18, 2026
@jss-spector jss-spector changed the title mod: bump git-module to fix git reset --end-of-options error Fix git reset --end-of-options error on file upload and edit Feb 18, 2026
@jss-spector jss-spector marked this pull request as ready for review February 18, 2026 23:06
@jss-spector jss-spector requested a review from unknwon as a code owner February 18, 2026 23:06
@unknwon unknwon added this to the 0.14.2 milestone Feb 18, 2026
…rintf)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CHANGELOG.md Outdated

### Changed

- Replaced `WriteString(fmt.Sprintf(...))` with `fmt.Fprintf(...)` in webhook and view code per staticcheck QF1012.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong entry

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@unknwon unknwon merged commit df467d8 into main Feb 19, 2026
11 of 12 checks passed
@unknwon unknwon deleted the jss/ntcu-fix-git-reset-command-error-option-end-of-options branch February 19, 2026 00:04
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.

Cannot upload / edit files via web interface after upgrading from GOGS 13 to 14.1 Can't use API to PUT file the second time

2 participants