Do not show commit button if add / revert fails

(Fixes issue #1864)

Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>