summaryrefslogtreecommitdiffstats
path: root/modules/timeutil
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-04-03 10:16:46 +0800
committerGitHub <noreply@github.com>2024-04-03 02:16:46 +0000
commit654cfd1dfbd3f3f1d94addee50b6fe2b018a49c3 (patch)
tree61dc77223994809dfeb3183351a37f19e3563839 /modules/timeutil
parentb28d3a4218b1338ce6f683d11993081b722bae0a (diff)
downloadgitea-654cfd1dfbd3f3f1d94addee50b6fe2b018a49c3.tar.gz
gitea-654cfd1dfbd3f3f1d94addee50b6fe2b018a49c3.zip
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>
Diffstat (limited to 'modules/timeutil')
-rw-r--r--modules/timeutil/timestamp.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/timeutil/timestamp.go b/modules/timeutil/timestamp.go
index 27a80b6682..e77652b24f 100644
--- a/modules/timeutil/timestamp.go
+++ b/modules/timeutil/timestamp.go
@@ -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