threads / bug / 12684

builtin-remote bug: Stale tracking branch after "git clone"

Subject: builtin-remote bug: Stale tracking branch after "git clone"

## tl;dr

One message between Mar 14, 2008 and Mar 14, 2008.

replies: 0people: 1as markdown or json

Teemu Likonen· Mar 14, 2008, 07:51 UTC · lore
Hi

I have found a recently added bug. I'm using git version 1.5.4.4.537.gb75aa ('master' branch). I can't describe it technically so I just type instructions how to reproduce it:

1) Clone some git repository. I think any repo will do.
2) Type "git remote show origin" in that cloned repo. You'll see 
something like this:
* remote origin
  URL: [...]
  Remote branch merged with 'git pull' while on branch master
    master
  Stale tracking branch (use 'git remote prune')
    HEAD
  Tracked remote branch
    master

$ find .git/refs/remotes .git/refs/remotes/ .git/refs/remotes/origin .git/refs/remotes/origin/HEAD .git/refs/remotes/origin/master

3) As git asked, type "git remote prune origin".
4) Do "git remote show origin" again and it will display this:
* remote origin
  URL: [...]
  Remote branch merged with 'git pull' while on branch master
    master
  New remote branch (next fetch will store in remotes/origin)
    master [Hmm, interesting]
Seems like .git/refs/remotes/origin/master was deleted:

$ find .git/refs/remotes/ .git/refs/remotes/ .git/refs/remotes/origin .git/refs/remotes/origin/HEAD

5) Now fetch that "new" remote branch again with "git fetch" and you'll 
see this:
error: refs/remotes/origin/HEAD points nowhere!
From [...]
 * [new branch]      master     -> origin/master
6) Now we're back in the beginning. See item 2.

← back to recent threads