[Bps-public-commit] Shipwright branch, master, updated. 94b0f726ff4978058ecdfa89b82fc64fc5d3979b
? sunnavy
sunnavy at bestpractical.com
Mon May 24 04:38:11 EDT 2010
The branch, master has been updated
via 94b0f726ff4978058ecdfa89b82fc64fc5d3979b (commit)
via 80c6acada4de1471a79c25118c5691d9620f21ce (commit)
from 75a499d2297be213de6d8bbc8061a2f10bad1f28 (commit)
Summary of changes:
lib/Shipwright/Source/Git.pm | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
- Log -----------------------------------------------------------------
commit 80c6acada4de1471a79c25118c5691d9620f21ce
Author: sunnavy <sunnavy at bestpractical.com>
Date: Mon May 24 16:12:53 2010 +0800
permit failure of git pull
diff --git a/lib/Shipwright/Source/Git.pm b/lib/Shipwright/Source/Git.pm
index f0bd3b0..91902ad 100644
--- a/lib/Shipwright/Source/Git.pm
+++ b/lib/Shipwright/Source/Git.pm
@@ -65,8 +65,8 @@ sub _run {
@cmds = sub {
my $cwd = getcwd();
chdir $cloned_path;
- run_cmd(
- [ $ENV{'SHIPWRIGHT_GIT'}, 'pull' ] );
+ # can be failed if we are not in any branch, e.g. in a tag instead
+ run_cmd( [ $ENV{'SHIPWRIGHT_GIT'}, 'pull' ], 1 );
chdir $cwd;
};
}
commit 94b0f726ff4978058ecdfa89b82fc64fc5d3979b
Author: sunnavy <sunnavy at bestpractical.com>
Date: Mon May 24 16:38:42 2010 +0800
use "git rev-parse --verify HEAD" to get rev: thanks to rbuels
diff --git a/lib/Shipwright/Source/Git.pm b/lib/Shipwright/Source/Git.pm
index 91902ad..815b1bb 100644
--- a/lib/Shipwright/Source/Git.pm
+++ b/lib/Shipwright/Source/Git.pm
@@ -84,11 +84,10 @@ sub _run {
[ $ENV{'SHIPWRIGHT_GIT'}, 'checkout', $self->version ] );
}
else {
- my ($out) = run_cmd(
- [ $ENV{'SHIPWRIGHT_GIT'}, 'log', '-n', 1 ] );
- if ( $out =~ /^commit\s+(\w+)/m ) {
- $self->version($1);
- }
+ my ($version) = run_cmd(
+ [ $ENV{'SHIPWRIGHT_GIT'}, 'rev-parse', '--verify', 'HEAD' ] );
+ chomp $version;
+ $self->version( $version );
}
chdir $cwd;
remove_tree( $path ) if -e $path;
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list