summaryrefslogtreecommitdiff
path: root/Documentation/git-commit.txt
diff options
context:
space:
mode:
authorLibravatar Johan Herland <johan@herland.net>2011-02-17 00:12:20 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-02-16 16:55:56 -0800
commit21b5b1e8dc9bed2b518defe29d69ebc27da4b68f (patch)
tree7b56cf9df74614e1e71592cf1222f992a0eaf5b5 /Documentation/git-commit.txt
parentPrepare for 1.7.3.4 (diff)
downloadtgif-21b5b1e8dc9bed2b518defe29d69ebc27da4b68f.tar.xz
branch/checkout --track: Ensure that upstream branch is indeed a branch
When creating a new branch using the --track option, we must make sure that we don't try to set an upstream that does not make sense to follow (using 'git pull') or update (using 'git push'). The current code checks against using HEAD as upstream (since tracking a symref doesn't make sense). However, tracking a tag doesn't make sense either. Indeed, tracking _any_ ref that is not a (local or remote) branch doesn't make sense, and should be disallowed. This patch achieves this by checking that the ref we're trying to --track resides within refs/heads/* or refs/remotes/*. This new check replaces the previous check against HEAD. A couple of testcases are also added, verifying that we cannot create branches with tags as upstreams. Finally, some selftests relying on using a non-branch as an upstream have been reworked or removed: - t6040: Reverse the meaning of two tests that depend on the ability to use (lightweight and annotated) tags as upstreams. These two tests were originally added in commits 1be570f and 57ffc5f, and this patch reverts the intention of those two commits. - t7201: Remove part of a test (introduced in 9188ed8) relying on a non-branch as upstream. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-commit.txt')
0 files changed, 0 insertions, 0 deletions