Skip to content

Commit c54c7b3

Browse files
pastgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fdf96a2 commit c54c7b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/hooks/pre-auto-gc-battery

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ elif grep -q "AC Power \+: 1" /proc/pmu/info 2>/dev/null
3333
then
3434
exit 0
3535
elif test -x /usr/bin/pmset && /usr/bin/pmset -g batt |
36-
grep -q "Currently drawing from 'AC Power'"
36+
grep -q "drawing from 'AC Power'"
3737
then
3838
exit 0
3939
fi

0 commit comments

Comments
 (0)