mirror of
https://github.com/NixOS/hydra.git
synced 2024-10-22 22:59:17 +02:00
GitInput: Allow setting a umask
This commit is contained in:
parent
cf9f38e43f
commit
56bf875c26
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue