Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lunny Xiao
5f82ead13c
Simplify how git repositories are opened ( #28937 )
...
## Purpose
This is a refactor toward building an abstraction over managing git
repositories.
Afterwards, it does not matter anymore if they are stored on the local
disk or somewhere remote.
## What this PR changes
We used `git.OpenRepository` everywhere previously.
Now, we should split them into two distinct functions:
Firstly, there are temporary repositories which do not change:
```go
git.OpenRepository(ctx, diskPath)
```
Gitea managed repositories having a record in the database in the
`repository` table are moved into the new package `gitrepo`:
```go
gitrepo.OpenRepository(ctx, repo_model.Repo)
```
Why is `repo_model.Repository` the second parameter instead of file
path?
Because then we can easily adapt our repository storage strategy.
The repositories can be stored locally, however, they could just as well
be stored on a remote server.
## Further changes in other PRs
- A Git Command wrapper on package `gitrepo` could be created. i.e.
`NewCommand(ctx, repo_model.Repository, commands...)`. `git.RunOpts{Dir:
repo.RepoPath()}`, the directory should be empty before invoking this
method and it can be filled in the function only. #28940
- Remove the `RepoPath()`/`WikiPath()` functions to reduce the
possibility of mistakes.
---------
Co-authored-by: delvh <dev.lh@web.de>
10 months ago
..
actions
Fix incorrect action duration time when rerun the job before executed once ( #28364 )
10 months ago
setting
Preserve BOM in web editor ( #28935 )
10 months ago
activity.go
Implement FSFE REUSE for golang files ( #21840 )
2 years ago
attachment.go
Even more `db.DefaultContext` refactor ( #27352 )
1 year ago
blame.go
Use information from previous blame parts ( #28572 )
11 months ago
branch.go
Adjust object format interface ( #28469 )
11 months ago
cherry_pick.go
Upgrade to golangci-lint@v1.55.0 ( #27756 )
1 year ago
commit.go
Simplify how git repositories are opened ( #28937 )
10 months ago
compare.go
Simplify how git repositories are opened ( #28937 )
10 months ago
download.go
Less naked returns ( #25713 )
1 year ago
editor.go
Preserve BOM in web editor ( #28935 )
10 months ago
editor_test.go
Simplify how git repositories are opened ( #28937 )
10 months ago
find.go
Implement FSFE REUSE for golang files ( #21840 )
2 years ago
githttp.go
Adjust object format interface ( #28469 )
11 months ago
githttp_test.go
Fix http protocol auth ( #27875 )
1 year ago
helper.go
Improve tree not found page ( #26570 )
1 year ago
helper_test.go
Make web context initialize correctly for different cases ( #26726 )
1 year ago
issue.go
Add ability to see open and closed issues at the same time ( #28757 )
10 months ago
issue_content_history.go
Fix missing check ( #28406 )
11 months ago
issue_dependency.go
Upgrade to golangci-lint@v1.55.0 ( #27756 )
1 year ago
issue_label.go
Even more `db.DefaultContext` refactor ( #27352 )
1 year ago
issue_label_test.go
Move web/api context related testing function into a separate package ( #26859 )
1 year ago
issue_lock.go
Penultimate round of `db.DefaultContext` refactor ( #27414 )
1 year ago
issue_pin.go
Fix missing check ( #28406 )
11 months ago
issue_stopwatch.go
Final round of `db.DefaultContext` refactor ( #27587 )
1 year ago
issue_test.go
Implement FSFE REUSE for golang files ( #21840 )
2 years ago
issue_timetrack.go
Final round of `db.DefaultContext` refactor ( #27587 )
1 year ago
issue_watch.go
Revert adding htmx until we finaly decide to add it ( #28879 )
10 months ago
main_test.go
make writing main test easier ( #27270 )
1 year ago
middlewares.go
Fix viewing wiki commit on empty repo ( #28040 )
1 year ago
migrate.go
Next round of `db.DefaultContext` refactor ( #27089 )
1 year ago
milestone.go
Rework markup link rendering ( #26745 )
10 months ago
packages.go
Fix the display of org level badges ( #26504 )
1 year ago
patch.go
Upgrade to golangci-lint@v1.55.0 ( #27756 )
1 year ago
projects.go
Rework markup link rendering ( #26745 )
10 months ago
projects_test.go
Move web/api context related testing function into a separate package ( #26859 )
1 year ago
pull.go
Simplify how git repositories are opened ( #28937 )
10 months ago
pull_review.go
Don't reload timeline page when (un)resolving or replying conversation ( #28654 )
10 months ago
release.go
Rework markup link rendering ( #26745 )
10 months ago
release_test.go
Move more functions to db.Find ( #28419 )
10 months ago
render.go
Preserve BOM in web editor ( #28935 )
10 months ago
repo.go
Add support for sha256 repositories ( #23894 )
10 months ago
search.go
Refactor indexer ( #25174 )
1 year ago
topic.go
Next round of `db.DefaultContext` refactor ( #27089 )
1 year ago
treelist.go
Implement FSFE REUSE for golang files ( #21840 )
2 years ago
view.go
Preserve BOM in web editor ( #28935 )
10 months ago
view_test.go
Implement FSFE REUSE for golang files ( #21840 )
2 years ago
wiki.go
Simplify how git repositories are opened ( #28937 )
10 months ago
wiki_test.go
Simplify how git repositories are opened ( #28937 )
10 months ago