From be3748e1ec8fe337f97f1509d9d8a814290c8d20 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Wed, 25 Apr 2012 13:49:28 +0200 Subject: [PATCH] In case of deep clone, make sure there is local branch. --- src/lib/Hydra/Helper/AddBuilds.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/Hydra/Helper/AddBuilds.pm b/src/lib/Hydra/Helper/AddBuilds.pm index 3a81cb5f..feecf0de 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; } else { # This command force the update of the local branch to be in the same as # the remote branch for whatever the repository state is. This command mirror