diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-06-15 23:48:59 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-06-18 16:14:56 +0300 |
commit | 35b19af5bb585276821dc17f0f487d6cd2ece598 (patch) | |
tree | 60fcadcaf5c68da13f326f783c94fcf63a197513 /tests | |
parent | 5598e284b9337872608d478854643f12d1d34751 (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')
-rwxr-xr-x | tests/common/git/init | 4 | ||||
-rw-r--r-- | tests/common/git/state0/libbar.tar | bin | 174080 -> 174080 bytes | |||
-rw-r--r-- | tests/common/git/state0/libfoo.tar | bin | 440320 -> 450560 bytes | |||
-rw-r--r-- | tests/common/git/state0/libfox.tar | bin | 245760 -> 245760 bytes | |||
-rw-r--r-- | tests/common/git/state0/links.tar | bin | 276480 -> 276480 bytes | |||
-rw-r--r-- | tests/common/git/state0/style-basic.tar | bin | 81920 -> 81920 bytes | |||
-rw-r--r-- | tests/common/git/state0/style.tar | bin | 143360 -> 143360 bytes | |||
-rw-r--r-- | tests/common/git/state1/libbaz.tar | bin | 61440 -> 61440 bytes | |||
-rw-r--r-- | tests/common/git/state1/libfoo.tar | bin | 501760 -> 512000 bytes | |||
-rw-r--r-- | tests/common/git/state1/libfox.tar | bin | 245760 -> 245760 bytes | |||
-rw-r--r-- | tests/common/git/state1/style-basic.tar | bin | 81920 -> 81920 bytes | |||
-rw-r--r-- | tests/common/git/state1/style.tar | bin | 143360 -> 143360 bytes | |||
-rwxr-xr-x | tests/publish | 2 | ||||
-rw-r--r-- | tests/remote-git.testscript | 4 | ||||
-rw-r--r-- | tests/rep-fetch-git-commit.testscript | 35 | ||||
-rw-r--r-- | tests/rep-fetch.testscript | 2 |
16 files changed, 42 insertions, 5 deletions
diff --git a/tests/common/git/init b/tests/common/git/init index 9519779..8cac2da 100755 --- a/tests/common/git/init +++ b/tests/common/git/init @@ -114,8 +114,10 @@ git -C style-basic.git checkout master # git -C libbar.git init git -C libbar.git add '*' -git -C libbar.git submodule add -b stable ../style-basic.git extras git -C libbar.git commit -am 'Create' +git -C libbar.git tag -a 'v1.0.0' -m 'Tag version 1.0.0' +git -C libbar.git submodule add -b stable ../style-basic.git extras +git -C libbar.git commit -am 'Add extras' # Create master branch for libfoo.git, adding style.git and libbar.git as # submodules. diff --git a/tests/common/git/state0/libbar.tar b/tests/common/git/state0/libbar.tar Binary files differindex b63a7b5..cf00747 100644 --- a/tests/common/git/state0/libbar.tar +++ b/tests/common/git/state0/libbar.tar diff --git a/tests/common/git/state0/libfoo.tar b/tests/common/git/state0/libfoo.tar Binary files differindex 200ebf5..05281ee 100644 --- a/tests/common/git/state0/libfoo.tar +++ b/tests/common/git/state0/libfoo.tar diff --git a/tests/common/git/state0/libfox.tar b/tests/common/git/state0/libfox.tar Binary files differindex df77539..b024532 100644 --- a/tests/common/git/state0/libfox.tar +++ b/tests/common/git/state0/libfox.tar diff --git a/tests/common/git/state0/links.tar b/tests/common/git/state0/links.tar Binary files differindex 25c4089..3769fd1 100644 --- a/tests/common/git/state0/links.tar +++ b/tests/common/git/state0/links.tar diff --git a/tests/common/git/state0/style-basic.tar b/tests/common/git/state0/style-basic.tar Binary files differindex 7223c52..01eadbc 100644 --- a/tests/common/git/state0/style-basic.tar +++ b/tests/common/git/state0/style-basic.tar diff --git a/tests/common/git/state0/style.tar b/tests/common/git/state0/style.tar Binary files differindex 93007d5..042684e 100644 --- a/tests/common/git/state0/style.tar +++ b/tests/common/git/state0/style.tar diff --git a/tests/common/git/state1/libbaz.tar b/tests/common/git/state1/libbaz.tar Binary files differindex d46b25c..5238b4a 100644 --- a/tests/common/git/state1/libbaz.tar +++ b/tests/common/git/state1/libbaz.tar diff --git a/tests/common/git/state1/libfoo.tar b/tests/common/git/state1/libfoo.tar Binary files differindex 683f5ab..c0e7523 100644 --- a/tests/common/git/state1/libfoo.tar +++ b/tests/common/git/state1/libfoo.tar diff --git a/tests/common/git/state1/libfox.tar b/tests/common/git/state1/libfox.tar Binary files differindex 49c4752..e502974 100644 --- a/tests/common/git/state1/libfox.tar +++ b/tests/common/git/state1/libfox.tar diff --git a/tests/common/git/state1/style-basic.tar b/tests/common/git/state1/style-basic.tar Binary files differindex 5ab346d..1ef7399 100644 --- a/tests/common/git/state1/style-basic.tar +++ b/tests/common/git/state1/style-basic.tar diff --git a/tests/common/git/state1/style.tar b/tests/common/git/state1/style.tar Binary files differindex 71be292..2a0120b 100644 --- a/tests/common/git/state1/style.tar +++ b/tests/common/git/state1/style.tar diff --git a/tests/publish b/tests/publish index df355eb..bd1f327 100755 --- a/tests/publish +++ b/tests/publish @@ -60,7 +60,7 @@ for r in $(find test -type d -regex '.*/git/.*/[^/]+\.git'); do # Push local branches and tags to the remote repository, if it exists. # - if git ls-remote "$url" 2>/dev/null >&2; then + if git ls-remote --refs "$url" 2>/dev/null >&2; then # Point the bare repository origin to the remote repository. # git -C $br config remote.origin.url "$url" diff --git a/tests/remote-git.testscript b/tests/remote-git.testscript index 40f7ae5..56c33b7 100644 --- a/tests/remote-git.testscript +++ b/tests/remote-git.testscript @@ -63,8 +63,8 @@ else rep_git_https_dumb = "https://build2.org/bpkg/git/$cmd" rep_git_https_smart = "https://git.build2.org/testing/bpkg/advonly/$cmd" rep_git_https_smart_unadv = "https://git.build2.org/testing/bpkg/unadv/$cmd" - rep_git_git = "git://git.build2.org/testing/bpkg/unadv/$cmd" - rep_git_ssh = "ssh://git.build2.org/var/scm/testing/bpkg/unadv/$cmd" + rep_git_git = "git://git.build2.org/testing/bpkg/advonly/$cmd" + rep_git_ssh = "ssh://git.build2.org/var/scm/testing/bpkg/advonly/$cmd" rep_git = $rep_git_https_dumb # Default remote repository URL. end 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 + } +} diff --git a/tests/rep-fetch.testscript b/tests/rep-fetch.testscript index 8e7011a..c2fd4cc 100644 --- a/tests/rep-fetch.testscript +++ b/tests/rep-fetch.testscript @@ -809,7 +809,7 @@ else { $clone_root_cfg && $rep_add "$rep_git_git/state0/libfoo.git#master"; $* 2>! &cfg/.bpkg/repos/*/***; - $rep_add "$rep_git_https_smart_unadv/state0/libfoo.git#master"; + $rep_add "$rep_git_https_smart/state0/libfoo.git#master"; $* 2>>~%EOE% %fetching git:.+libfoo#master% |