From d48dab7a284ba9cc27fa2b4004d4adea3c5bc868 Mon Sep 17 00:00:00 2001 From: Lieven Hollevoet Date: Thu, 8 Dec 2016 21:21:21 +0100 Subject: [PATCH] Don't run git when we're not in a repository --- bin/mh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/mh b/bin/mh index 0e85956c4..3dc23b6da 100755 --- a/bin/mh +++ b/bin/mh @@ -81,7 +81,8 @@ BEGIN { $Version .= " (compiler: $Info{Perl_compiled})" if $Info{Perl_compiled}; #Create a build number if this is unstable version - if ( lc $Version eq 'unstable' ) { + # but only do this if we're on a .git version, not when we started from a zip file archive + if ( lc $Version eq 'unstable' && -e '../.git' ) { my $build = lc `git describe --long`; $build =~ /(\S+)-(\d+)-g([0-9a-f]+)/; $Version = "$1 Build $2 ($3)" if ( $1 && defined($2) && $3 ); @@ -291,7 +292,7 @@ BEGIN { chomp $autover; close(VERSION); } - if ( lc $autover eq 'unstable' ) { + if ( lc $autover eq 'unstable' && -e '../.git') { my $build_date = `git show -s --format="%ci"`; $Version_date = $build_date if ( $build_date =~ /^\d\d\d\d-\d\d-\d\d/ );