'Why doesn't git repo checkout the branch specified?

I've just started a new job where they're using git-repo. There's an XML manifest file that contains all the different repos that looks like:

    <project path="company/project-name"
    name="project-name.git"
    remote="company-server"
    revision="current-branch" />

But this doesn't setup that branch for that repo. If I open the directory and type git status I get:

$ git status
HEAD detached at 1234567
nothing to commit, working tree clean

This means I can't do a git pull:

$ git pull
You are not currently on a branch.
Please specify which branch you want to merge with.

I have to do a git checkout of the correct branch to fix it:

$ git checkout current-branch
Branch 'current-branch' set up to track remote branch 'current-branch' from 'company-server'.
Switched to a new branch 'current-branch'

Then I can do git pull successfully.

Is this how git-repo is intended to work? It seems wrong to me. Or is there any way to get it to checkout the branches properly?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source