summaryrefslogtreecommitdiff
path: root/t/t9806-git-p4-options.sh
diff options
context:
space:
mode:
authorPete Wyckoff <pw@padd.com>2013-01-14 19:46:59 -0500
committerJunio C Hamano <gitster@pobox.com>2013-01-15 09:46:29 -0800
commit55d124376f1d5d91be4376016d92a6ca6474428a (patch)
tree7f88c160dac645ef493f2a4a8bca8b86c7ea480a /t/t9806-git-p4-options.sh
parent3b650fc9869a51190578aed8014d906f01f510a9 (diff)
downloadgit-55d124376f1d5d91be4376016d92a6ca6474428a.tar.gz
git p4: create p4/HEAD on initial clone
There is code to create a symbolic reference from p4/HEAD to p4/master. This allows saying "git show p4" as a shortcut to "git show p4/master", for example. But this reference was only created on the second "git p4 sync" (or first sync after a clone). Make it work on the initial clone or sync. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9806-git-p4-options.sh')
-rwxr-xr-xt/t9806-git-p4-options.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t9806-git-p4-options.sh b/t/t9806-git-p4-options.sh
index 844aae048e..4900aef19e 100755
--- a/t/t9806-git-p4-options.sh
+++ b/t/t9806-git-p4-options.sh
@@ -83,6 +83,29 @@ test_expect_failure 'sync --branch updates specified branch' '
)
'
+# allows using the refname "p4" as a short name for p4/master
+test_expect_success 'clone creates HEAD symbolic reference' '
+ git p4 clone --dest="$git" //depot &&
+ test_when_finished cleanup_git &&
+ (
+ cd "$git" &&
+ git rev-parse --verify refs/remotes/p4/master >master &&
+ git rev-parse --verify p4 >p4 &&
+ test_cmp master p4
+ )
+'
+
+test_expect_success 'clone --branch creates HEAD symbolic reference' '
+ git p4 clone --branch=refs/remotes/p4/sb --dest="$git" //depot &&
+ test_when_finished cleanup_git &&
+ (
+ cd "$git" &&
+ git rev-parse --verify refs/remotes/p4/sb >sb &&
+ git rev-parse --verify p4 >p4 &&
+ test_cmp sb p4
+ )
+'
+
test_expect_success 'clone --changesfile' '
test_when_finished "rm cf" &&
printf "1\n3\n" >cf &&