From: Shawn O. Pearce Date: Wed, 11 Feb 2009 18:01:00 GMT Subject: Re: [PATCH 3/3] completion: Prevents GIT_PS1_DIRTYSTATE from breaking when CWD is .git Message-ID: <20090211180100.GJ30949@spearce.org> In-Reply-To: <499308DA.9090208@tedpavlic.com> Ted Pavlic wrote: > >> You have at least three possible states: >> * You are not in git repository at all; >> * You are somewhere in $GIT_DIR, perhaps in a bare repository, perhaps a >> repository with a work tree. >> * You are inside a work tree. > > It seems like (psuedocode)... > > if git rev-parse --is-inside-git-dir; then > use '!' flag to indicate caution > > elif git rev-parse --is-inside-work-tree; then > proceed as before (with '*' and '+' flags) > > else > do nothing > > I think that handles those cases. No? Yes, that looks right to me. -- Shawn.