Skip to content

Commit b423234

Browse files
committed
Merge branch 'ab/pre-auto-gc-battery'
A sample auto-gc hook (in contrib/) to skip auto-gc while on battery has been updated to almost always allow running auto-gc unless on_ac_power command is absolutely sure that we are on battery power (earlier, it skipped unless the command is sure that we are on ac power). * ab/pre-auto-gc-battery: hooks/pre-auto-gc-battery: allow gc to run on non-laptops
2 parents 571e472 + 781262c commit b423234

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
@@ -17,7 +17,7 @@
1717
# ln -sf /usr/share/git-core/contrib/hooks/pre-auto-gc-battery \
1818
# hooks/pre-auto-gc
1919

20-
if test -x /sbin/on_ac_power && /sbin/on_ac_power
20+
if test -x /sbin/on_ac_power && (/sbin/on_ac_power;test $? -ne 1)
2121
then
2222
exit 0
2323
elif test "$(cat /sys/class/power_supply/AC/online 2>/dev/null)" = 1

0 commit comments

Comments
 (0)