forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
git-r3_GIT_DIR.sh
executable file
·60 lines (43 loc) · 2.15 KB
/
git-r3_GIT_DIR.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source tests-common.sh
inherit git-r3
testdir=${pkg_root}/git
mkdir "${testdir}" || die "unable to mkdir testdir"
cd "${testdir}" || die "unable to cd to testdir"
EGIT3_STORE_DIR=store
mkdir "${EGIT3_STORE_DIR}" || die "unable to mkdir store"
# Test cleaning up canonical repo URI
test_repouri() {
local uri=${1}
local expect=${2}
local -x GIT_DIR
tbegin "GIT_DIR for ${uri}"
_git-r3_set_gitdir "${uri}" &>/dev/null
local got=${GIT_DIR#${EGIT3_STORE_DIR}/}
[[ ${expect} == ${got} ]]
tend ${?} || eerror "Expected: ${expect}, got: ${got}"
}
test_repouri git://git.overlays.gentoo.org/proj/portage.git proj_portage.git
test_repouri https://git.overlays.gentoo.org/gitroot/proj/portage.git proj_portage.git
test_repouri git+ssh://[email protected]/proj/portage.git proj_portage.git
test_repouri git://anongit.freedesktop.org/mesa/mesa mesa_mesa.git
test_repouri ssh://git.freedesktop.org/git/mesa/mesa mesa_mesa.git
test_repouri http://anongit.freedesktop.org/git/mesa/mesa.git mesa_mesa.git
test_repouri http://cgit.freedesktop.org/mesa/mesa/ mesa_mesa.git
test_repouri https://code.google.com/p/snakeoil/ snakeoil.git
test_repouri git://git.code.sf.net/p/xournal/code xournal_code.git
test_repouri http://git.code.sf.net/p/xournal/code xournal_code.git
test_repouri git://git.gnome.org/glibmm glibmm.git
test_repouri https://git.gnome.org/browse/glibmm glibmm.git
test_repouri ssh://[email protected]/git/glibmm glibmm.git
test_repouri git://git.kernel.org/pub/scm/git/git.git git_git.git
test_repouri http://git.kernel.org/pub/scm/git/git.git git_git.git
test_repouri https://git.kernel.org/pub/scm/git/git.git git_git.git
test_repouri https://git.kernel.org/cgit/git/git.git/ git_git.git
#test_repouri [email protected]:gentoo/identity.gentoo.org.git gentoo_identity.gentoo.org.git
test_repouri https://github.com/gentoo/identity.gentoo.org.git gentoo_identity.gentoo.org.git
#test_repouri [email protected]:mgorny/python-exec.git mgorny_python-exec.git
test_repouri https://[email protected]/mgorny/python-exec.git mgorny_python-exec.git
texit