From 224bdeeccae05f3b988537e7a6a1ae89ad0b20a2 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 3 Jul 2023 13:10:39 -0300 Subject: [PATCH] fix: no usar Dir.chdir --- app/models/site/repository.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/models/site/repository.rb b/app/models/site/repository.rb index 62e4c45e..d149b732 100644 --- a/app/models/site/repository.rb +++ b/app/models/site/repository.rb @@ -158,10 +158,8 @@ class Site cmd = 'git gc' r = nil - Dir.chdir(path) do - Open3.popen2e(env, cmd, unsetenv_others: true) do |_, _, t| - r = t.value - end + Open3.popen2e(env, cmd, unsetenv_others: true, chdir: path) do |_, _, t| + r = t.value end r&.success?