1
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-05-02 05:35:24 +00:00
gitea/services/pull
Lunny Xiao 32b97b3ce8
Uniform all temporary directories and allow customizing temp path ()
This PR uniform all temporary directory usage so that it will be easier
to manage.

Relate to  

- [x] Added a new setting to allow users to configure the global
temporary directory.
- [x] Move all temporary files and directories to be placed under
os.Temp()/gitea.
- [x] `setting.Repository.Local.LocalCopyPath` now will be
`setting.TempPath/local-repo` and the customized path is removed.
```diff
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;[repository.local]
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Path for local repository copy. Defaults to  TEMP_PATH + `local-repo`, this is deprecated and cannot be changed
-;LOCAL_COPY_PATH = local-repo
```

- [x] `setting.Repository.Upload.TempPath` now will be
`settting.TempPath/uploads` and the customized path is removed.
```diff
;[repository.upload]
-;;
-;; Path for uploads. Defaults to TEMP_PATH + `uploads`
-;TEMP_PATH = uploads
```

- [x] `setting.Packages.ChunkedUploadPath` now will be
`settting.TempPath/package-upload` and the customized path is removed.
```diff
;[packages]
-;;
-;; Path for chunked uploads. Defaults it's `package-upload` under `TEMP_PATH` unless it's an absolute path.
-;CHUNKED_UPLOAD_PATH = package-upload
```

- [x] `setting.SSH.KeyTestPath` now will be
`settting.TempPath/ssh_key_test` and the customized path is removed.
```diff
[server]
-;;
-;; Directory to create temporary files in when testing public keys using ssh-keygen,
-;; default is the system temporary directory.
-;SSH_KEY_TEST_PATH =
```

TODO:
- [ ] setting.PprofDataPath haven't been changed because it may need to
be kept until somebody read it but temp path may be clean up any time.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-08 16:15:28 +00:00
..
check_test.go Enable testifylint rules () 2025-03-31 01:53:48 -04:00
check.go Enable addtional linters () 2025-04-01 10:14:01 +00:00
comment.go Update misspell to 0.5.1 and add misspellings.csv () 2024-04-27 08:03:49 +00:00
commit_status_test.go Fixing the issue when status check per rule matches multiple actions () 2024-03-08 05:02:13 +00:00
commit_status.go Move git references checking to gitrepo packages to reduce expose of repository path () 2025-03-15 19:48:59 -07:00
edits.go
lfs.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods () 2023-12-07 15:27:36 +08:00
main_test.go make writing main test easier () 2023-09-28 01:38:53 +00:00
merge_ff_only.go Remove context from git struct () 2025-03-04 11:56:11 -08:00
merge_merge.go Remove context from git struct () 2025-03-04 11:56:11 -08:00
merge_prepare.go Remove context from git struct () 2025-03-04 11:56:11 -08:00
merge_rebase.go Remove context from git struct () 2025-03-04 11:56:11 -08:00
merge_squash.go Enable addtional linters () 2025-04-01 10:14:01 +00:00
merge_test.go
merge.go Enable addtional linters () 2025-04-01 10:14:01 +00:00
patch_unmerged.go Remove context from git struct () 2025-03-04 11:56:11 -08:00
patch.go Uniform all temporary directories and allow customizing temp path () 2025-04-08 16:15:28 +00:00
protected_branch.go Move git references checking to gitrepo packages to reduce expose of repository path () 2025-03-15 19:48:59 -07:00
pull_test.go Simplify how git repositories are opened () 2024-01-27 21:09:51 +01:00
pull.go Refactor Branch struct in package modules/git () 2025-04-02 17:31:32 +00:00
review_test.go Prevent re-review and dismiss review actions on closed and merged PRs () 2024-03-28 15:19:24 +00:00
review.go Enable addtional linters () 2025-04-01 10:14:01 +00:00
reviewer_test.go Enable tenv and testifylint rules () 2024-12-15 10:41:29 +00:00
reviewer.go Fix get reviewers' bug () 2024-11-22 10:44:48 -05:00
temp_repo.go Uniform all temporary directories and allow customizing temp path () 2025-04-08 16:15:28 +00:00
update_rebase.go Remove context from git struct () 2025-03-04 11:56:11 -08:00
update.go Enable addtional linters () 2025-04-01 10:14:01 +00:00