aboutsummaryrefslogtreecommitdiff
path: root/tests/rep-fetch-git-commit.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-06-15 23:48:59 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-06-18 16:14:56 +0300
commit35b19af5bb585276821dc17f0f487d6cd2ece598 (patch)
tree60fcadcaf5c68da13f326f783c94fcf63a197513 /tests/rep-fetch-git-commit.testscript
parent5598e284b9337872608d478854643f12d1d34751 (diff)
Fix failure to fetch git repository location with tagged commit id for git 2.22
Also make some cleanups (always probe URLs prior to git-ls-remote, use peeled reference ids to identify repository fragments, etc).
Diffstat (limited to 'tests/rep-fetch-git-commit.testscript')
-rw-r--r--tests/rep-fetch-git-commit.testscript35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/rep-fetch-git-commit.testscript b/tests/rep-fetch-git-commit.testscript
index 3f0fbe7..8af9ea1 100644
--- a/tests/rep-fetch-git-commit.testscript
+++ b/tests/rep-fetch-git-commit.testscript
@@ -3,6 +3,7 @@
# license : MIT; see accompanying LICENSE file
+git clone "$rep_git/state0/style-basic.git" 2>! &style-basic/***
++git clone "$rep_git/state0/libbar.git" 2>! &libbar/***
: unadvertised
:
@@ -94,3 +95,37 @@ if ($git_fully_supported || $git_protocol != 'https-smart-unadv')
EOE
}
}
+
+: peeled
+:
+{
+ +git -C ../libbar log '--pretty=format:%H' --all --grep='Create' | \
+ set commit
+
+ : remap
+ :
+ : Test that the commit id is properly remapped back to the advertised tag
+ : reference.
+ :
+ {
+ $clone_root_cfg && $rep_add "$rep/state0/libbar.git#@$commit";
+
+ $* 2>>~"%EOE%"
+ %fetching git:.+libbar#@$commit%
+ %.+
+ EOE
+ }
+
+ : peel
+ :
+ : Test that the tag reference is properly peeled into the commit id.
+ :
+ {
+ $clone_root_cfg && $rep_add "$rep/state0/libbar.git#v1.0.0,-$commit";
+
+ $* 2>>~%EOE%
+ %.+
+ 0 package(s) in 1 repository(s)
+ EOE
+ }
+}