From 35b19af5bb585276821dc17f0f487d6cd2ece598 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 15 Jun 2019 23:48:59 +0300 Subject: 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). --- tests/rep-fetch-git-commit.testscript | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'tests/rep-fetch-git-commit.testscript') 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 + } +} -- cgit v1.1