aboutsummaryrefslogtreecommitdiff
path: root/tests/rep-fetch-git.test
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-02-12 17:30:16 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-02-12 17:34:55 +0300
commitb7763416f8a1e4940a10336d3a8b9fbbb879f414 (patch)
tree31f1bc7427181aa81984a639d998ca4e99058199 /tests/rep-fetch-git.test
parentecb1efeebaa5597bee4cfdaab7bff4007b73127d (diff)
Clone and fetch git repositories
Diffstat (limited to 'tests/rep-fetch-git.test')
-rw-r--r--tests/rep-fetch-git.test62
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/rep-fetch-git.test b/tests/rep-fetch-git.test
new file mode 100644
index 0000000..1330d20
--- /dev/null
+++ b/tests/rep-fetch-git.test
@@ -0,0 +1,62 @@
+# file : tests/rep-fetch-git.test
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+# All tests use the same repository infrastructure present in the initial and
+# the final states. See tests/common/git/init script for more details.
+#
+
+rep_add += --type git -d cfg 2>!
+test.cleanups += &cfg/.bpkg/repositories/*/***
+
++if ($git_protocol == 'local')
+ rep = "$rep_git_local"
+elif ($git_protocol == 'https-dumb')
+ rep = "$rep_git_https_dumb"
+elif ($git_protocol == 'https-smart')
+ rep = "$rep_git_https_smart"
+elif ($git_protocol == 'https-smart-unadv')
+ rep = "$rep_git_https_smart_unadv"
+elif ($git_protocol == 'git')
+ rep = "$rep_git_git"
+else
+ exit "unexpected git protocol '$git_protocol'"
+end
+
+# Repository URL prefix for use with git commands.
+#
+# Note that git supports none of the standard 'file:' URL notations on Windows,
+# so we produce one that is acceptable for git.
+#
++if ($git_protocol == 'local' && $cxx.target.class == 'windows')
+ rep_git = "$regex.replace($rep, '^file:/', 'file://')"
+else
+ rep_git = "$rep"
+end
+
+: branch
+:
+{
+ branch = 'master'
+ .include rep-fetch-git-branch.test
+}
+
+: lightweight-tag
+:
+{
+ branch = 'lightweight_tag'
+ .include rep-fetch-git-branch.test
+}
+
+: annotated-tag
+:
+{
+ branch = 'annotated_tag'
+ .include rep-fetch-git-branch.test
+}
+
+: commit
+:
+{
+ .include rep-fetch-git-commit.test
+}