Subject: Re: git-branch --print-current

From: "Shawn O. Pearce" <[email-masked]>
Date: Sun, 4 Jan 2009 18:18:32 -0800

Junio C Hamano <[email-masked]> wrote:
> demerphq <[email-masked]> writes:
> 
> > The version im using, from git version 1.6.0.4.724.ga0d3a produces the
> > following error:
> >
> > cut: ./HEAD: No such file or directory
> >
> > when in the .git/refs directory.
> 
> Personally, I think you are nuts to be in .git/refs and want to use that
> information for anything useful, but if it is an easy enough fix, a patch
> would be useful.

I agree, its nuts to be there.  But this also does show up in 1.6.1.
What's odd is the output of rev-parse --git-dir is wrong:

  $ cd .git/refs
  $ git rev-parse --git-dir
  .

Its *not* ".", its "..", I'm *in* the directory.  This throws off
a lot of the other operations we do in __git_ps1, like detecting
the repository state by checking MERGE_HEAD or rebase-apply.

I think we should fix rev-parse --git-dir if we can, not the bash
completion code.

-- 
Shawn.