1
0
Fork 0
mirror of https://github.com/NixOS/hydra.git synced 2024-10-17 16:37:26 -04:00
This commit is contained in:
Christian Kögler 2024-10-17 19:48:31 +02:00 committed by GitHub
commit 7c723f2fd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -142,14 +142,19 @@ sub fetchInput {
die "error creating git repo in `$clonePath':\n$res->{stderr}" if $res->{status}; die "error creating git repo in `$clonePath':\n$res->{stderr}" if $res->{status};
} }
# This command forces the update of the local branch to be in the same as $res = run(cmd => ["git", "cat-file", "-t", $branch], dir => $clonePath);
# the remote branch for whatever the repository state is. This command mirrors if (! _isHash($branch) || $res->{status}) {
# only one branch of the remote repository. # This command forces the update of the local branch to be in the same as
my $localBranch = _isHash($branch) ? "_hydra_tmp" : $branch; # the remote branch for whatever the repository state is. This command mirrors
$res = run(cmd => ["git", "fetch", "-fu", "origin", "+$branch:$localBranch"], dir => $clonePath, # only one branch of the remote repository.
timeout => $cfg->{timeout}); my $localBranch = _isHash($branch) ? "_hydra_tmp" : $branch;
$res = run(cmd => ["git", "fetch", "-fu", "origin"], dir => $clonePath, timeout => $cfg->{timeout}) if $res->{status}; $res = run(cmd => ["git", "fetch", "-fu", "origin", "+$branch:$localBranch"], dir => $clonePath,
die "error fetching latest change from git repo at `$uri':\n$res->{stderr}" if $res->{status}; timeout => $cfg->{timeout});
$res = run(cmd => ["git", "fetch", "-fu", "origin"], dir => $clonePath, timeout => $cfg->{timeout}) if $res->{status};
die "error fetching latest change from git repo at `$uri':\n$res->{stderr}" if $res->{status};
} else {
$res = run(cmd => ["git", "branch", "-f", "_hydra_tmp", "$branch"], dir => $clonePath, timeout => $cfg->{timeout});
}
# If deepClone is defined, then we look at the content of the repository # If deepClone is defined, then we look at the content of the repository
# to determine if this is a top-git branch. # to determine if this is a top-git branch.