GitInput: Allow setting a umask

This commit is contained in:
Janne Heß 2022-06-12 18:30:30 +02:00
parent cf9f38e43f
commit 56bf875c26
No known key found for this signature in database
GPG key ID: 69165158F05265DF

View file

@ -126,6 +126,13 @@ sub fetchInput {
_printIfDebug "'$name': override '$opt_name' with input value: $opt_value\n";
}
# Set desired umask
my $old_umask;
if (defined($cfg->{umask})) {
$old_umask = umask();
umask($cfg->{umask});
}
# Clone or update a branch of the repository into our SCM cache.
my $cacheDir = getSCMCacheDir . "/git";
mkpath($cacheDir);
@ -239,6 +246,10 @@ sub fetchInput {
my $gitTag = grab(cmd => ["git", "describe", "--always", "$revision"], dir => $clonePath, chomp => 1);
my $shortRev = grab(cmd => ["git", "rev-parse", "--short", "$revision"], dir => $clonePath, chomp => 1);
if (defined($old_umask)) {
umask($old_umask);
}
return
{ uri => $uri
, storePath => $storePath