diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-04-12 06:44:07 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-04-12 08:47:50 -0700 |
commit | 11d3f1aa5fce1838483a48e9fbabbd762e0dda97 (patch) | |
tree | da1fe29f8568b125d479e2e135aad6c4b62b10f1 /commit.c | |
parent | ab2b3aadf322fccffeaabe7470e1b5905537a888 (diff) |
ci: skip sudo when we are already root
Our "install-dependencies.sh" script is executed by non-dockerized jobs
to install dependencies. These jobs don't run with "root" permissions,
but with a separate user. Consequently, we need to use sudo(8) there to
elevate permissions when installing packages.
We're about to merge "install-docker-dependencies.sh" into that script
though, and our Docker containers do run as "root". Using sudo(8) is
thus unnecessary there, even though it would be harmless. On some images
like Alpine Linux though there is no sudo(8) available by default, which
would consequently break the build.
Adapt the script to make "sudo" a no-op when running as "root" user.
This allows us to easily reuse the script for our dockerized jobs.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions