summaryrefslogtreecommitdiff
path: root/diffcore-pathspec.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-04-02 23:25:01 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-04-03 05:22:27 (GMT)
commitc72112e6e1593bd77132a815ba484d0ff880a7b4 (patch)
tree02a0b232638adab9f100e84f6165600afc77747e /diffcore-pathspec.c
parent40e907bff260a94306b1fe43d0fb829bf54e3103 (diff)
downloadgit-c72112e6e1593bd77132a815ba484d0ff880a7b4.zip
git-c72112e6e1593bd77132a815ba484d0ff880a7b4.tar.gz
git-c72112e6e1593bd77132a815ba484d0ff880a7b4.tar.bz2
git-clone: fix handling of upsteram whose HEAD does not point at master.
When cloning from a remote repository that has master, main, and origin branches _and_ with the HEAD pointing at main branch, we did quite confused things during clone. So this cleans things up. The behaviour is a bit different between separate remotes/ layout and the mixed branches layout. The newer layout with $GIT_DIR/refs/remotes/$origin/, things are simpler and more transparent: - remote branches are copied to refs/remotes/$origin/. - HEAD points at the branch with the same name as the remote HEAD points at, and starts at where the remote HEAD points at. - $GIT_DIR/remotes/$origin file is set up to fetch all remote branches, and merge the branch HEAD pointed at at the time of the cloning. Everything-in-refs/heads layout was the more confused one, but cleaned up like this: - remote branches are copied to refs/heads, but the branch "$origin" is not copied, instead a copy of the branch the remote HEAD points at is created there. - HEAD points at the branch with the same name as the remote HEAD points at, and starts at where the remote HEAD points at. - $GIT_DIR/remotes/$origin file is set up to fetch all remote branches except "$origin", and merge the branch HEAD pointed at at the time of the cloning. With this, the remote has master, main and origin, and its HEAD points at main, you could: git clone $URL --origin upstream to use refs/heads/upstream as the tracking branch for remote "main", and your primary working branch will also be "main". "master" and "origin" are used to track the corresponding remote branches and with this setup they do not have any special meaning. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diffcore-pathspec.c')
0 files changed, 0 insertions, 0 deletions