libgit: use a switch in `canDoWork`
libgit: use a switch in `canDoWork`

Suggested by songgao.

Issue: #1802

keybase/client,keybase/client,keybase/kbfs,keybase/kbfs,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/kbfs,keybase/client,keybase/kbfs,keybase/client,keybase/client,keybase/client,keybase/client