From: keni Date: Mon, 2 Mar 2015 21:32:29 +0000 (-0500) Subject: Fix NHtext when GIT_DIR is not defined. X-Git-Tag: NetHack-3.6.0_RC01~630 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23f213bc63bada1a4ae39c98988721cbe4717d74;p=nethack Fix NHtext when GIT_DIR is not defined. --- diff --git a/DEVEL/hooksdir/NHtext b/DEVEL/hooksdir/NHtext index 861b9e6b1..0cc065db3 100755 --- a/DEVEL/hooksdir/NHtext +++ b/DEVEL/hooksdir/NHtext @@ -15,6 +15,13 @@ use strict; sub git_config { my($section, $var) = @_; local($_); + # Sigh. Without GIT_DIR we have to do it the slow way, and sometimes we don't + # have GIT_DIR. + if(0 == length($ENV{GIT_DIR})){ + my $raw = `git config --local --get $section.$var`; + chomp($raw); + return $raw + } open(CONFIG, "<", "$ENV{GIT_DIR}/config") or die "Missing .git/config: $!"; while(){ m/^\[$section]/ && do {