[Nix-dev] [Nix-commits] [NixOS/hydra] be3748: In case of deep clone, make sure there is local br...
Rob Vermaas
rob.vermaas at gmail.com
Wed Apr 25 21:42:58 CEST 2012
Hi,
>> diff --git a/src/lib/Hydra/Helper/AddBuilds.pm b/src/lib/Hydra/Helper/AddBuilds.pm
>> index 3a81cb5..feecf0d 100644
>> --- a/src/lib/Hydra/Helper/AddBuilds.pm
>> +++ b/src/lib/Hydra/Helper/AddBuilds.pm
>> @@ -343,6 +343,10 @@ sub fetchInputGit {
>> ($res, $stdout, $stderr) = captureStdoutStderr(600,
>> ("git", "pull", "--ff-only", "-fu", "--all"));
>> die "Error pulling latest change from git repo at `$uri':\n$stderr" unless $res;
>> + # Make sure there is a local branch
>> + ($res, $stdout, $stderr) = captureStdoutStderr(600,
>> + ("git", "checkout", "-f", $branch));
>> + die "Error making local branch $branch in $clonePath from git repo at `$uri':\n$stderr" unless $res;
>
> You should avoid checkout, in fact it would be better to have
> bare/mirror repository for git.
> I you want to create a local branch, use "git fetch -fu origin
> +$branch:$branch".
>
> I think you can get rid of the deep clone condition here and use the
> other branch which already have "git fetch -fu origin
> +$branch:$branch".
Doesn't the deep clone need all remote branches to be fetched in stead
of the one branch? Maybe I am just confused to what a deep clone is
supposed to be.
Cheers,
Rob
--
Rob Vermaas
[email] rob.vermaas at gmail.com
More information about the nix-dev
mailing list