diff options
| author | Takashi Kokubun <takashikkbn@gmail.com> | 2025-09-27 20:15:45 -0700 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2025-09-27 20:19:25 -0700 |
| commit | 8300c52f565e5a106037bb7ec25eec78c15995a8 (patch) | |
| tree | eb1b091030a73f7cb519fd70ff08f4f0d57db901 | |
| parent | 4a1d078636776d8c6544ee18d05730c2ea31ef99 (diff) | |
Reuse a cmd array created for printing
Fixes 21c7131df818c1f7f571d4ccf9be150d2c9cc374 differently.
This makes it less likely that the printed command is deviated from
what's actually executed.
| -rwxr-xr-x | tool/auto-style.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tool/auto-style.rb b/tool/auto-style.rb index 259ed377bc..0d6fe0255a 100755 --- a/tool/auto-style.rb +++ b/tool/auto-style.rb @@ -71,9 +71,9 @@ class Git private def git(*args, **opts) - cmd = ['git', *args].shelljoin - puts "+ #{cmd}" - ret = with_clean_env { system('git', *args, **opts) } + cmd = ['git', *args] + puts "+ #{cmd.shelljoin}" + ret = with_clean_env { system(*cmd, **opts) } unless ret or opts[:err] abort "Failed to run: #{cmd}" end |
