hooks/pre-auto-gc-battery: allow gc to run on non-laptops
commit781262c5e7ad4a7813c528803117ed0d2e8c5172
authorAdam Borowski <kilobyte@angband.pl>
Wed, 28 Feb 2018 22:12:04 +0000 (28 23:12 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Feb 2018 22:24:46 +0000 (28 14:24 -0800)
tree3c9a9a78a247d72538392fc19e25ac4037b3089f
parent38e79b1fdab9244e1727d0698afcf3bb8956c0a4
hooks/pre-auto-gc-battery: allow gc to run on non-laptops

Desktops and servers tend to have no power sensor, thus on_ac_power returns
255 ("unknown").  Thus, let's take any answer other than 1 ("battery") as
no contraindication to run gc.

If that tool returns "unknown", there's no point in querying other sources
as it already queried them, and is smarter than us (can handle multiple
adapters).

Reported by: Xin Li <delphij@google.com>
Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/hooks/pre-auto-gc-battery