Check for detached head before referencing branch (close #14)