Skip to content

Commit

Permalink
hooks/pre-auto-gc: adjust power checking for newer OS X
Browse files Browse the repository at this point in the history
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 <pastith@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Panagiotis Astithas authored and Junio C Hamano committed Jun 12, 2015
1 parent fdf96a2 commit c54c7b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/hooks/pre-auto-gc-battery
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c54c7b3

Please sign in to comment.