[Bps-public-commit] Shipwright branch, master, updated. 8c0966b490fa85203bc81ba8d16e84cf47ec2d4a

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sun Apr 26 05:27:13 EDT 2009


The branch, master has been updated
       via  8c0966b490fa85203bc81ba8d16e84cf47ec2d4a (commit)
      from  b8c98af12113b37cc0e6e92d94a88bed34531e09 (commit)

Summary of changes:
 lib/Shipwright/Backend/Git.pm |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit 8c0966b490fa85203bc81ba8d16e84cf47ec2d4a
Author: sunnavy <sunnavy at gmail.com>
Date:   Sun Apr 26 17:27:00 2009 +0800

    only commit and push when chdir to clone_dir with success. now we have usable git backend :)

diff --git a/lib/Shipwright/Backend/Git.pm b/lib/Shipwright/Backend/Git.pm
index 438fa49..9a23b2d 100644
--- a/lib/Shipwright/Backend/Git.pm
+++ b/lib/Shipwright/Backend/Git.pm
@@ -141,14 +141,18 @@ sub import {
 sub DESTROY {
     my $self = shift;
     my $cwd  = getcwd;
-    chdir $self->cloned_dir;
+    if ( $self->cloned_dir ) {
+        chdir $self->cloned_dir or return;
 
-    Shipwright::Util->run( [ $ENV{'SHIPWRIGHT_GIT'}, 'add', '.' ] );
-#    TODO comment need to be something special
-    Shipwright::Util->run(
-        [ $ENV{'SHIPWRIGHT_GIT'}, 'commit', '-m', 'comment', '-a' ], 1 );
-    Shipwright::Util->run( [ $ENV{'SHIPWRIGHT_GIT'}, 'push' ] );
-    chdir $cwd;
+        Shipwright::Util->run( [ $ENV{'SHIPWRIGHT_GIT'}, 'add', '.' ] );
+
+        #    TODO comment need to be something special
+        Shipwright::Util->run(
+            [ $ENV{'SHIPWRIGHT_GIT'}, 'commit', '-m', 'comment' ], 1 );
+        Shipwright::Util->run( [ $ENV{'SHIPWRIGHT_GIT'}, 'push' ] );
+        chdir $cwd;
+
+    }
 }
 
 =back

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list