Ensure some commands are only executed within a git repository