[Nix-dev] [Nix-commits] [NixOS/hydra] be3748: In case of deep clone, make sure there is local br...

Nicolas Pierron nicolas.b.pierron at gmail.com
Wed Apr 25 20:18:15 CEST 2012


On Wed, Apr 25, 2012 at 04:49, Rob Vermaas <rob.vermaas at gmail.com> wrote:
>  Log Message:
>  -----------
>  In case of deep clone, make sure there is local branch.
>
>
> 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".

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/


More information about the nix-dev mailing list