Fix undeclared variable if committish not given