#633694 git checkout --track remotename/branchname incorrectly says "Already on 'branchname'"

Package:
git
Source:
git
Description:
fast, scalable, distributed revision control system
Submitter:
Josh Triplett
Date:
2011-07-15 02:00:03 UTC
Severity:
minor
#633694#3
Date:
2011-07-12 22:55:15 UTC
From:
To:
In a new empty repo created with "git init":

$ git remote add -f b /home/josh/src/apters/prototype/new-store/repos/b
Updating b
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
 * [new branch]      master     -> b/master
$ git checkout --track b/master
Branch master set up to track remote branch master from b.
Already on 'master'

But I don't have master checked out before the call to checkout, making
"Already on 'master'" incorrect.

- Josh Triplett

#633694#8
Date:
2011-07-12 23:02:13 UTC
From:
To:
severity 633694 minor
tags 633694 + upstream
quit

Hi,

Josh Triplett wrote:

Sure you do.  It's just a branch yet to be born.

But I agree that the output would be better without that last line.  Thanks
for reporting it.

Regards,
Jonathan

#633694#17
Date:
2011-07-15 01:58:04 UTC
From:
To:
At that point, the working copy contains no files.  Sure, git assumes
I'll start development on a branch named "master", but "git checkout
--track b/master" effectively creates and checks out a new master
branch, making it irrelevant that "git init" arranged for a master
branch to come into existence the first time I did a "git commit".

Thanks!

- Josh Triplett