Add sanity checks for far, far distant dates.
[p5sagit/p5-mst-13.2.git] / make_patchnum.pl
index 1644d41..28148de 100644 (file)
@@ -19,7 +19,7 @@ This program creates the files holding the information
 about locally applied patches to the source code. The created
 files are  C<git_version.h> and C<lib/Config_git.pl>.
 
-=item C<lib/Config_git.pl>
+=head2 C<lib/Config_git.pl>
 
 Contains status information from git in a form meant to be processed
 by the tied hash logic of Config.pm. It is actually optional,
@@ -137,8 +137,10 @@ elsif (-d "$srcdir/.git") {
     my ($remote,$merge);
     if (length $branch) {
         $merge= backtick("git config branch.$branch.merge");
+        $merge = "" unless $? == 0;
         $merge =~ s!^refs/heads/!!;
         $remote= backtick("git config branch.$branch.remote");
+        $remote = "" unless $? == 0;
     }
     $commit_id = backtick("git rev-parse HEAD");
     $describe = backtick("git describe");