IsBranchExist and IsTagExist now ask got.RefExists instead of git's cat-file
batch. got's exit status is useless here: `got ref -l <unknown>` exits 0 with
no output, and an empty repository reports "HEAD: refs/heads/main" for a branch
that does not exist yet. The wrapper therefore parses the "<name>: <value>"
line and follows symbolic entries with a bounded depth.
IsReferenceExist/IsObjectExist keep the cat-file batch: they answer "is this
object present" for bare and short commit IDs, which got ref cannot, and
`got cat` resolves unknown arguments as paths in HEAD's tree, so it would
report file names as existing objects. That gap is documented, not silent.
Verified: go test ./modules/got ./modules/git (ref_test.go covers both ref
behaviours, the empty repository, and the enclosing-repository escape;
ref_got_test.go covers true/false branches and tags plus a missing got binary).
Full go test ./modules/... ./services/... ./models/... ./routers/... and
make -C cgi check pass.
Assisted-by: splinter:claude-opus-4
Branch listing moved to got, so the migration list and the got integration
notes now say GetBranchNames is covered. Also record the two got behaviours
the code has to guard: `-r` searching upwards on a non-repository path, and
got refusing a repository whose empty directories were lost.
Assisted-by: OpenCode:DeepSeek-V4.1-Flash
Add BranchCommitID to modules/got and route GetBranchCommitID through it. Cover existing and missing branches and the no-fallback case.
Assisted-by: OpenCode:DeepSeek-V4.1-Flash
Use got ref -s when the target branch exists and write HEAD atomically for unborn branches, where got ref -s cannot operate. Route git.SetDefaultBranch through the got wrapper and cover both paths plus the no-bypass case in tests.
Assisted-by: OpenCode:DeepSeek-V4.1-Flash
Add IsEmpty and DefaultBranch to modules/got and route Repository.IsEmpty and GetDefaultBranch through them. Keep SetDefaultBranch on git because got ref -s requires the target branch to exist, which excludes unborn branches. Cover the wiring and the no-fallback behaviour with tests.
Assisted-by: OpenCode:DeepSeek-V4.1-Flash
Read the ref query parameter, validate it, pass it to got for tree, blob, raw, and log views, and render a no-JavaScript branch/tag bar. Preserve the ref in repository links and cover dev/main switching and traversal rejection in tests.
Assisted-by: OpenCode:DeepSeek-V4.1-Flash
Add modules/got with a got runner, version check, repository detection, and idempotent bare init. Route bare repository creation from InitRepositoryLocal through got; non-bare temp worktrees keep git. Add [git] GOT_PATH and tests, including an explicit no-fallback test.
Assisted-by: OpenCode:DeepSeek-V4.1-Flash
Parse eight-slot CDE palette files in addition to key=value themes. Map the active frame, inactive frame, text-area, application-background and front-panel slots, derive readable text and code colours, and add a sample palette plus tests.
Assisted-by: OpenCode:DeepSeek-V4.1-Flash
CGI servers are not required to set HTTP_HOST. Fall back to SERVER_NAME:SERVER_PORT, omitting 80 and 443, and document the pages host contract. Also omit the redundant Status header on 200 file responses.
Assisted-by: OpenCode:DeepSeek-V4.1-Flash
Add a Gotea Pages prototype: a pages branch is checked out with got, built with the vendored bb, swapped atomically into a pages root, and served only on a separate host from an allowlist. A post-receive hook installer wires the flow through Gitea delegate hooks. The CGI pages mode isolates the host and contains paths with realpath.
Assisted-by: OpenCode:DeepSeek-V4.1-Flash
Add a C99/POSIX CGI browser for bare Git-format repositories, using got for every read. Pages are HTML 4.01 Transitional with CSS1, table layout, no JavaScript, and a configurable CDE/Motif palette. The browser supports flat and owner-scoped repository layouts, tree, blob, raw, log, and commit views, and has tests plus generated-page validation.
Assisted-by: OpenCode:DeepSeek-V4.1-Flash
Moves the "Hacking on Gitea" page out of the documentation website and into the repository as `docs/development.md`, so contributors find build and test instructions next to the code. The content has been cleaned up and corrected for in-repo use.
---------
Signed-off-by: bircni <bircni@icloud.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Replace webpack with Vite 8 as the frontend bundler. Frontend build is
around 3-4 times faster than before. Will work on all platforms
including riscv64 (via wasm).
`iife.js` is a classic render-blocking script in `<head>` (handles web
components/early DOM setup). `index.js` is loaded as a `type="module"`
script in the footer. All other JS chunks are also module scripts
(supported in all browsers since 2018).
Entry filenames are content-hashed (e.g. `index.C6Z2MRVQ.js`) and
resolved at runtime via the Vite manifest, eliminating the `?v=` cache
busting (which was unreliable in some scenarios like vscode dev build).
Replaces: https://github.com/go-gitea/gitea/pull/36896
Fixes: https://github.com/go-gitea/gitea/issues/17793
Signed-off-by: silverwind <me@silverwind.io>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Fixed minor typos in CODE_OF_CONDUCT.md and README.md
I use the hashtag for a project at my university
---------
Signed-off-by: MrMars98 <Marcel.Lang98@googlemail.com>
- Update README.md to include links to Traditional and Simplified
Chinese translations.
- Add README.zh-cn.md file containing the Simplified Chinese version of
the README.
- Add README.zh-tw.md file containing the Traditional Chinese version of
the README.
- Delete README_ZH.md file.
---------
Signed-off-by: appleboy <appleboy.tw@gmail.com>
~~Waiting for the upload of screenshots~~
I have a good idea about the screenshots. I will do it later.
---------
Co-authored-by: Gary Wang <git@blumia.net>
Came to the conclusion that a simple format Readme is easier to read
than the previous fancy centered stuff.
---------
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
Move `public/*` to `public/assets/*`
Some old PRs (like #15219) introduced inconsistent directory system.
For example: why the local directory "public" is accessed by
`http://site/assets`? How to serve the ".well-known" files properly in
the public directory?
For convention rules, the "public" directory is widely used for the
website's root directory. It shouldn't be an exception for Gitea.
So, this PR makes the things consistent:
* `http://site/assets/foo` means `{CustomPath}/public/assets/foo`.
* `{CustomPath}/public/.well-known` and `{CustomPath}/public/robots.txt`
can be used in the future.
This PR is also a prerequisite for a clear solution for:
* #21942
* #25892
* discourse.gitea.io: [.well-known path serving custom files behind
proxy?](https://discourse.gitea.io/t/well-known-path-serving-custom-files-behind-proxy/5445/1)
This PR is breaking for users who have custom "public" files (CSS/JS).
After getting approvals, I will update the documents.
----
## ⚠️ BREAKING ⚠️
If you have files in your "custom/public/" folder, please move them to
"custom/public/assets/".
---------
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Giteabot <teabot@gitea.io>
@techknowlogick
Only added a placeholder, the index is possibly wrong. But I think you
need to do/finalize that as the opencollective holder :)
You can take the logo of the opencollective account. LMK if I can help
more!
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <matti@mdranta.net>