use Fcntl qw(FD_CLOEXEC F_SETFD F_GETFD);
use POSIX qw(dup2);
+use strict;
+use warnings;
sub stream_to_string {
my ($res) = @_;
$pid;
}
+sub require_git ($;$) {
+ my ($req, $maybe) = @_;
+ my ($req_maj, $req_min) = split(/\./, $req);
+ my ($cur_maj, $cur_min) = (`git --version` =~ /version (\d+)\.(\d+)/);
+
+ my $req_int = ($req_maj << 24) | ($req_min << 16);
+ my $cur_int = ($cur_maj << 24) | ($cur_min << 16);
+ if ($cur_int < $req_int) {
+ return 0 if $maybe;
+ plan skip_all => "git $req+ required, have $cur_maj.$cur_min";
+ }
+ 1;
+}
+
1;