Refactor "dump" sub-command (#30240)

Major changes:

* Move some functions like "addReader" / "isSubDir" /
"addRecursiveExclude" to a separate package, and add tests
* Clarify the filename&dump type logic and add tests
* Clarify the logger behavior and remove FIXME comments

Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
wxiaoguangandGiteabot authored and GitHub committed 2024-04-03 02:16:46 +00:00
1 parent b28d3a4218
commit 654cfd1dfb
6 files changed
+374 -229

No files matched your search

+2 -1
View File
@@ -21,8 +21,9 @@ var (
)
// MockSet sets the time to a mocked time.Time
func MockSet(now time.Time) {
func MockSet(now time.Time) func() {
mockNow = now
return MockUnset
}
// MockUnset will unset the mocked time.Time