Detect when git is not in the path
authorTodd Lyons <tlyons@exim.org>
Wed, 27 Nov 2013 17:37:32 +0000 (09:37 -0800)
committerTodd Lyons <tlyons@exim.org>
Wed, 27 Nov 2013 17:37:32 +0000 (09:37 -0800)
EximBuild/SCM.pm

index df8862e09cd18ff743d20c05169962069f444f2d..becd24e037ea73a6c7e3b65bf3434180763b3a07 100644 (file)
@@ -202,6 +202,15 @@ sub checkout
 
     if (-d $target)
     {
+        # First check and see if git is in path
+        `which git 2>&1`;
+        if ($? != 0)
+        {
+            my @ret = `env`;
+            unshift @ret, "git not found in path\n";
+            main::send_result("$target-Git",$status,\@ret);
+        }
+        
         chdir $target;
         my @branches = `git branch 2>&1`;
         unless (grep {/^\* bf_$branch$/} @branches)