From 05ebf34441f8eb294dd145476e9f35c4efb251a2 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Tue, 7 Sep 2010 14:56:53 +0000 Subject: [PATCH] hydra: do not use refs/heads while checking for latest commit in branch --- src/lib/Hydra/Helper/AddBuilds.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/Hydra/Helper/AddBuilds.pm b/src/lib/Hydra/Helper/AddBuilds.pm index 43b2e437..b32c8e72 100644 --- a/src/lib/Hydra/Helper/AddBuilds.pm +++ b/src/lib/Hydra/Helper/AddBuilds.pm @@ -318,10 +318,12 @@ sub fetchInputGit { die "Error pulling latest change git repo at `$uri':\n$stderr" unless $res; (my $res1, $stdout, $stderr) = captureStdoutStderr(600, - ("git", "ls-remote", $clonePath, "refs/heads/".$branch)); - die "Cannot get head revision of Git branch '$branch' at `$uri':\n$stderr" unless $res1; + ("git", "ls-remote", $clonePath, $branch)); + + die "Cannot get head revision of Git branch '$branch' at `$uri':\n$stderr" unless $res1 ; - (my $revision, my $ref) = split ' ', $stdout; + my ($first) = split /\n/, $stdout; + (my $revision, my $ref) = split ' ', $first; die unless $revision =~ /^[0-9a-fA-F]+$/; # Some simple caching: don't check a uri/branch more than once every hour, but prefer exact match on uri/branch/revision.