Skip to content

Commit d571493

Browse files
author
root
committed
Remove tmp directory when Gitolite settings change
1 parent b33e7aa commit d571493

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/use_cases/apply_settings.rb

+11
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def call
3030

3131

3232
def apply_settings
33+
check_gitolite_location
3334
check_repo_hierarchy
3435
check_gitolite_config
3536
check_gitolite_default_values
@@ -49,6 +50,16 @@ def value_has_changed?(params)
4950
end
5051

5152

53+
def check_gitolite_location
54+
## Gitolite location has changed. Remove temp directory, it will be recloned.
55+
if value_has_changed?(:gitolite_server_host) ||
56+
value_has_changed?(:gitolite_server_port) ||
57+
value_has_changed?(:gitolite_user)
58+
FileUtils.rm_rf RedmineGitHosting::Config.gitolite_temp_dir
59+
end
60+
end
61+
62+
5263
def check_repo_hierarchy
5364
## Storage infos has changed, move repositories!
5465
if value_has_changed?(:gitolite_global_storage_dir) ||

0 commit comments

Comments
 (0)