From: | "Michal Gorny (mgorny)" <mgorny@g.o> |
---|---|
To: | gentoo-commits@l.g.o |
Subject: | [gentoo-commits] gentoo-x86 commit in eclass/tests: git-r3:subrepos.sh |
Date: | Sun, 01 Jun 2014 22:08:03 |
Message-Id: | 20140601220759.9FA1C20034@flycatcher.gentoo.org |
1 | mgorny 14/06/01 22:07:59 |
2 | |
3 | Added: git-r3:subrepos.sh |
4 | Log: |
5 | Properly canonicalize relative submodule URIs, bug #501250. |
6 | |
7 | Revision Changes Path |
8 | 1.1 eclass/tests/git-r3:subrepos.sh |
9 | |
10 | file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/git-r3:subrepos.sh?rev=1.1&view=markup |
11 | plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/tests/git-r3:subrepos.sh?rev=1.1&content-type=text/plain |
12 | |
13 | Index: git-r3:subrepos.sh |
14 | =================================================================== |
15 | #!/bin/bash |
16 | |
17 | source tests-common.sh |
18 | |
19 | inherit git-r3 |
20 | |
21 | # Test getting submodule URIs |
22 | test_subrepos() { |
23 | local suburi=${1} |
24 | local expect=( "${@:2}" ) |
25 | |
26 | tbegin "subrepos for ${suburi} -> ${expect[0]}${expect[1]+...}" |
27 | |
28 | local subrepos |
29 | _git-r3_set_subrepos "${suburi}" "${repos[@]}" |
30 | |
31 | [[ ${expect[@]} == ${subrepos[@]} ]] |
32 | tend ${?} || eerror "Expected: ${expect[@]}, got: ${subrepos[@]}" |
33 | } |
34 | |
35 | # parent repos |
36 | repos=( http://foohub/fooman/foo.git git://foohub/fooman/foo.git ) |
37 | |
38 | # absolute URI |
39 | test_subrepos http://foo/bar http://foo/bar |
40 | test_subrepos /foo/bar /foo/bar |
41 | |
42 | # plain relative URI |
43 | test_subrepos ./baz http://foohub/fooman/foo.git/baz git://foohub/fooman/foo.git/baz |
44 | |
45 | # backward relative URIs |
46 | test_subrepos ../baz.git http://foohub/fooman/baz.git git://foohub/fooman/baz.git |
47 | test_subrepos ../../bazman/baz.git http://foohub/bazman/baz.git git://foohub/bazman/baz.git |
48 | |
49 | texit |