[Bps-public-commit] Test-Chimps-Client branch, master, updated. 5645d8a82d1f9a78e9fda3890b260f66544a7134
Kevin Falcone
falcone at bestpractical.com
Tue Aug 25 12:02:52 EDT 2009
The branch, master has been updated
via 5645d8a82d1f9a78e9fda3890b260f66544a7134 (commit)
from 09f2c2ff585e62bde956b1b88a85968109b12188 (commit)
Summary of changes:
lib/Test/Chimps/Smoker/Git.pm | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
- Log -----------------------------------------------------------------
commit 5645d8a82d1f9a78e9fda3890b260f66544a7134
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Tue Aug 25 12:02:09 2009 -0400
handle branches without a local ref
If the config specifies a branch that we don't have locally yet, set up
a local tracking branch so the rest of chimps can operate sanely
diff --git a/lib/Test/Chimps/Smoker/Git.pm b/lib/Test/Chimps/Smoker/Git.pm
index e9ba40b..36b0edc 100644
--- a/lib/Test/Chimps/Smoker/Git.pm
+++ b/lib/Test/Chimps/Smoker/Git.pm
@@ -65,6 +65,16 @@ sub clone {
$self->run_cmd( qw(clone), $self->uri, $dir );
chdir $dir or die "Couldn't change dir to $dir: $!";
+ # execute this manually since Chimps will die if system
+ # doesn't return 0 and we're actually expecting this to
+ # fail and return 0 in repos with multiple branches
+ my $cmd = 'git rev-parse -q --verify '.$self->branch;
+ my $local_branch = `$cmd`;
+ unless ( $local_branch ) {
+ # old gits (like the one on smoke) need -b with -t
+ $self->run_cmd( 'checkout', '-t', '-b', $self->branch, 'origin/'.$self->branch );
+ }
+
return 1;
}
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list