Commits at 334707fee90922e514485718088e3f0d55671c72
334707feDon't error when branch's commit doesn't exist (#19547)
* Don't error when branch's commit doesn't exist
- If one of the branches no longer exists, don't throw an error, it's possible that the branch was destroyed during the process. Simply skip it and disregard it.
- Resolves #19541
* Don't send empty objects
* Use more minimal approachGusted
authored at
GitHub
comitted at
a51efb4cSupport `hostname:port` to pass host matcher's check #19543 (#19543)
hostmatcher: split the hostname from the `hostname:port` string, use the correct hostname to do the match.wxiaoguang
authored at
GitHub
comitted at
8eb1cd92Add "Allow edits from maintainer" feature (#18002)
Adds a feature [like GitHub has](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) (step 7).
If you create a new PR from a forked repo, you can select (and change later, but only if you are the PR creator/poster) the "Allow edits from maintainers" option.
Then users with write access to the base branch get more permissions on this branch:
* use the update pull request button
* push directly from the command line (`git push`)
* edit/delete/upload files via web UI
* use related API endpoints
You can't merge PRs to this branch with this enabled, you'll need "full" code write permissions.
This feature has a pretty big impact on the permission system. I might forgot changing some things or didn't find security vulnerabilities. In this case, please leave a review or comment on this PR.
Closes #17728
Co-authored-by: 6543 <6543@obermui.de>qwerty287
authored at
GitHub
comitted at
92dfbadaBetter describe what `/repos/{owner}/{repo}/raw/{filepath}` returns on 200 (#19542)
- Set on the description that it returns the raw file content.
- Resolves #19514Gusted
authored at
GitHub
comitted at
06e4687cmore context for models (#19511)
make more usage of context, to have more db transaction in one session
(make diff of #9307 smaller)6543
authored at
GitHub
comitted at
332b2ecdPrevent intermittent race in attribute reader close (#19537)
There is a potential rare race possible whereby the c.running channel could
be closed twice. Looking at the code I do not see a need for this c.running
channel and therefore I think we can remove this. (I think the c.running
might have been some attempt to prevent a hang but the use of os.Pipes should
prevent that.)
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>zeripath
authored at
GitHub
comitted at
ca4b920bMake repository file list useable on mobile (#19515)
* Make repository file list useable on mobile
- When you're browsing a repository on mobile, you're met by a giant
block called the "repository file list". The current design is not
useable for mobile and is a big annoyance while browsing a repo on
mobile. This PR removes that annoyance by making it more suitable design
when on mobile.
- Adds HTML for the commit/file time to align it vertically(noticeable
on mobile, not on PC).
- Show all information horizontally and not vertically.
- Remove the last commit message of the file, there isn't enough space
on mobile to place this anywhere, so we're not trying to make a
best-effort here and instead just not display it.
* Remove unnecessary `!important`
* Fix broken HTML
* Simplify codeGusted
authored at
GitHub
comitted at
3e8aa42aUpdate image URL for Discord webhook (#19536)
Signed-off-by: jolheiser <john.olheiser@gmail.com>John Olheiser
authored at
GitHub
comitted at
b5383590Fix 64-bit atomic operations on 32-bit machines (#19531)
- Doing 64-bit atomic operations on 32-bit machines is a bit tricky by
golang, as they can only be done under certain set of
conditions(https://pkg.go.dev/sync/atomic#pkg-note-BUG).
- This PR fixes such case whereby the conditions weren't met, it moves
the int64 to the first field of the struct, which will 64-bit operations
happening on this property on 32-bit machines.
- Resolves #19518Gusted
authored at
GitHub
comitted at
af09136bFix `upgrade.sh` script error with `su -c` (#19483)
* Fix scirpt err with `su -c`, add env auto loading.
* Update upgrade.sh
* Update upgrade.sh
* Update contrib/upgrade.sh
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>YISH
authored at
GitHub
comitted at
5651c650When view _Siderbar or _Footer, just display once (#19501)
Co-authored-by: zeripath <art27@cantab.net>Lunny Xiao
authored at
GitHub
comitted at
2728f0c2Fix migrate release from github (#19510)
* Fix migrate release from github
* Fix bugLunny Xiao
authored at
GitHub
comitted at
41fcf7b7Prevent dangling archiver goroutine (#19516)
Within doArchive there is a service goroutine that performs the
archiving function. This goroutine reports its error using a `chan
error` called `done`. Prior to this PR this channel had 0 capacity
meaning that the goroutine would block until the `done` channel was
cleared - however there are a couple of ways in which this channel might
not be read.
The simplest solution is to add a single space of capacity to the
goroutine which will mean that the goroutine will always complete and
even if the `done` channel is not read it will be simply garbage
collected away.
(The PR also contains two other places when setting up the indexers
which do not leak but where the blocking of the sending goroutine is
also unnecessary and so we should just add a small amount of capacity
and let the sending goroutine complete as soon as it can.)
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>zeripath
authored at
GitHub
comitted at
3fbaa79cDon't let repo clone URL overflow (#19517)
- Apparently `<input>` elements differ from other elements have a size
attribute that act as a `min-width` CSS property, this causes a overflow
on mobile. By setting this size to `1` it doesn't try to force a
min-width and nicely shrink down.Gusted
authored at
GitHub
comitted at
cdab4622Add commit status popup to issuelist (#19375)
This gets the necessary data to the issuelist for it to support a clickable commit status icon which pops up the full list of commit statuses related to the commit. It accomplishes this without any additional queries or fetching as the existing codepath was already doing the necessary work but only returning the "last" status. All methods were wrapped to call the least-filtered version of each function in order to maximize code reuse.
Note that I originally left `getLastCommitStatus()` in `pull.go` which called to the new function, but `make lint` complained that it was unused, so I removed it. I would have preferred to keep it, but alas.
The only thing I'd still like to do here is force these popups to happen to the right by default instead of the left. I see that the only other place this is popping up right is on view_list.tmpl, but I can't figure out how/why right now.
Fixes #18810
parnic
authored at
GitHub
comitted at
0b38084bDisable unnecessary GitHooks elements (#18485)
* Disable unnecessary GitHooks elements
This mod fixes disabling unnecessary GitHooks elements.
Related: https://github.com/go-gitea/gitea/pull/13129
Author-Change-Id: IB#1115251
Paweł Bogusławski
authored at
GitHub
comitted at
85579dcaDisable unnecessary GitHooks elements
This mod fixes disabling unnecessary GitHooks elements.
Related: https://github.com/go-gitea/gitea/pull/13129
Author-Change-Id: IB#1115251
Pawel Boguslawski
authored at
Andrew Thornton
comitted at
076eaad7Improve dashboard's repo list performance (#18963)
* Improve dashboard's repo list performance
- Avoid a lot of database lookups for all the repo's, by adding a
undocumented "minimal" mode for this specific task, which returns the
data that's only needed by this list which doesn't require any database
lookups.
- Makes fetching these list faster.
- Less CPU overhead when a user visits home page.
* Refactor javascript code + fix Fork icon
- Use async in the function so we can use `await`.
- Remove `archivedFilter` check for count, as it doesn't make sense to
show the count of repos when you can't even see them(as they are
filited away).
* Add `count_only`
* Remove uncessary code
* Improve comment
Co-authored-by: delvh <dev.lh@web.de>
* Update web_src/js/components/DashboardRepoList.js
Co-authored-by: delvh <dev.lh@web.de>
* Update web_src/js/components/DashboardRepoList.js
Co-authored-by: delvh <dev.lh@web.de>
* By default apply minimal mode
* Remove `minimal` paramater
* Refactor count header
* Simplify init
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>Gusted
authored at
GitHub
comitted at
89eec15dBy default force vertical tabs on mobile (#19486)
* By default force vertical tabs on mobile
- While experimenting with using vertical tabs instead of horizontal
tabs on gitea for a better mobile experience, I made a recent
PR(https://github.com/go-gitea/gitea/pull/19468) in order to see if
there was any objections to this new behavior for the repo headers(one
of the most annoying horizontal tabs). This PR had no objections and
even a user commenting that this change is brilliant.
- This PR now improves upon the previous PR by making this the de-facto
behavior for all menu's on mobile. The only exemption is the navbar
which also uses the menu but caught some layout errors with the changes.
* Fix organisation
* Fix repo/wiki buttons
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>Gusted
authored at
GitHub
comitted at
d71df010Refactor readme file renderer (#19502)
* Refactor readme file renderer
* improveLunny Xiao
authored at
GitHub
comitted at
e4274f64Allow package dump skipping (#19506)
* Added addReader to support verbose.
* Allow skipping packages.
* Updated docs.
* Update cmd/dump.go
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>KN4CK3R
authored at
GitHub
comitted at
6dd36379Unset git author/committer variables when running integration tests (#19512)
TestAPIGitTag (and likely others) will fail if the running environment contains
GIT_AUTHOR_NAME and other env variables like it.
This PR simply unsets these when running the integration tests.
Fix #14247
Signed-off-by: Andrew Thornton <art27@cantab.net>zeripath
authored at
GitHub
comitted at
2347c9ebAllow commit status popup on /pulls page (#19507)
* Allow commit status popup on /pulls page
The /pulls page doesn't contain a "repository" element, so the early-out here was preventing the commit status popup hook from working. However, the only thing the .repository element is being used for here is determining whether the popup should be on the right or on the left, so we don't actually need the element to exist for the hook to work.
Pull request #19375 allows the statuses on /pulls pages to appear clickable, but this commit is required to make the popup actually work there.
* Move commit statuses popup hook to dedicated func
* Add missing importparnic
authored at
GitHub
comitted at
3c140f0dUse router param for filepath in GetRawFile (#19499)
* Use router param for filepath
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Move TreePath back into RepoRefForAPI
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>John Olheiser
authored at
GitHub
comitted at
03eba32bAdd a new menu in file view to open blame view and fix blame view select range bug (#19500)
Lunny Xiao
authored at
GitHub
comitted at
fef26c15Fix two UI bugs: JS error in imagediff.js, 500 error in diff/compare.tmpl
Co-authored-by: 6543 <6543@obermui.de>wxiaoguang
authored at
GitHub
comitted at