From: Panagiotis Astithas Date: Thu, 11 Jun 2015 14:37:25 +0000 (+0300) Subject: hooks/pre-auto-gc: adjust power checking for newer OS X X-Git-Tag: v2.5.0-rc0~7^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c54c7b376d73d2b3780475b18a6039721019aaba;p=git-core%2Fgit.git hooks/pre-auto-gc: adjust power checking for newer OS X The output of "pmset -g batt" changed at some point from "Currently drawing from 'AC Power'" to the slightly different "Now drawing from 'AC Power'". Starting the match from "drawing" makes the check work in both old and new versions of OS X. Signed-off-by: Panagiotis Astithas Signed-off-by: Junio C Hamano --- diff --git a/contrib/hooks/pre-auto-gc-battery b/contrib/hooks/pre-auto-gc-battery index 9d0c2d199..6a2cdebdb 100755 --- a/contrib/hooks/pre-auto-gc-battery +++ b/contrib/hooks/pre-auto-gc-battery @@ -33,7 +33,7 @@ elif grep -q "AC Power \+: 1" /proc/pmu/info 2>/dev/null then exit 0 elif test -x /usr/bin/pmset && /usr/bin/pmset -g batt | - grep -q "Currently drawing from 'AC Power'" + grep -q "drawing from 'AC Power'" then exit 0 fi