From: Ian Jackson Date: Sun, 22 Jan 2012 23:26:12 +0000 (+0000) Subject: add variable $git_command X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topbloke.git;a=commitdiff_plain;h=afc42a504608eb0ad3bbcab6f1fb8e91d0667fa5 add variable $git_command --- diff --git a/Topbloke.pm b/Topbloke.pm index b469f26..fac5c35 100644 --- a/Topbloke.pm +++ b/Topbloke.pm @@ -26,6 +26,8 @@ BEGIN { @EXPORT_OK = qw(); } +our $git_command = 'git'; + sub debug ($) { my ($msg) = @_; print STDERR "DEBUG: $msg\n" or die $!; @@ -49,18 +51,18 @@ sub run_git { die ref($ref)." @_ ?"; } } - open GIT, "-|", 'git', @_ or die $!; + open GIT, "-|", $git_command, @_ or die $!; if ($linecallr) { while () { - chomp or die "$_ ?"; + chomp or die "$git_command @_ gave $_ ?"; $linecallr->(); } GIT->eof or die $!; } if (!close GIT) { - die "git @_ $!" if $!; + die "$git_command @_ $!" if $!; die unless $?; - die "git @_ ($?)" unless $estatusr; + die "$git_command @_ ($?)" unless $estatusr; $$estatusr = $?; } else { $$estatusr = 0 if $estatusr;