]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-cvsexportcommit.perl
Fix a "pointer type missmatch" warning.
[thirdparty/git.git] / git-cvsexportcommit.perl
index 4863c91fe3c713c9e1b05d78b9bd22583ff4a4c0..32a488332122e005bd5007a23111eac1093b940a 100755 (executable)
@@ -15,9 +15,9 @@ unless ($ENV{GIT_DIR} && -r $ENV{GIT_DIR}){
     die "GIT_DIR is not defined or is unreadable";
 }
 
-our ($opt_h, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m );
+our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m );
 
-getopts('hpvcfam:');
+getopts('hPpvcfam:');
 
 $opt_h && usage();
 
@@ -89,7 +89,7 @@ if ($parent) {
            last;
        }; # found it
     }
-    die "Did not find $parent in the parents for this commit!" if !$found;
+    die "Did not find $parent in the parents for this commit!" if !$found and !$opt_P;
 } else { # we don't have a parent from the cmdline...
     if (@parents == 1) { # it's safe to get it from the commit
        $parent = $parents[0];
@@ -241,13 +241,14 @@ if ($opt_c) {
        die "Exiting: The commit did not succeed";
     }
     print "Committed successfully to CVS\n";
+    # clean up
+    unlink(".msg");
 } else {
     print "Ready for you to commit, just run:\n\n   $cmd\n";
 }
 
 # clean up
 unlink(".cvsexportcommit.diff");
-unlink(".msg");
 
 sub usage {
        print STDERR <<END;