git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
9c774872c4ee940b17a451814aa906261881aea0 blob 1044 bytes (raw)

 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
 
#!/bin/sh

test_description='verify discovery.bare checks'

. ./test-lib.sh

pwd="$(pwd)"

expect_allowed () {
	git rev-parse --absolute-git-dir >actual &&
	echo "$pwd/outer-repo/bare-repo" >expected &&
	test_cmp expected actual
}

expect_rejected () {
	test_must_fail git rev-parse --absolute-git-dir 2>err &&
	grep "discovery.bare" err
}

test_expect_success 'setup bare repo in worktree' '
	git init outer-repo &&
	git init --bare outer-repo/bare-repo
'

test_expect_success 'discovery.bare unset' '
	(
		cd outer-repo/bare-repo &&
		expect_allowed &&
		cd refs/ &&
		expect_allowed
	)
'

test_expect_success 'discovery.bare=always' '
	git config --global discovery.bare always &&
	(
		cd outer-repo/bare-repo &&
		expect_allowed &&
		cd refs/ &&
		expect_allowed
	)
'

test_expect_success 'discovery.bare=never' '
	git config --global discovery.bare never &&
	(
		cd outer-repo/bare-repo &&
		expect_rejected &&
		cd refs/ &&
		expect_rejected
	) &&
	(
		GIT_DIR=outer-repo/bare-repo &&
		export GIT_DIR &&
		expect_allowed
	)
'

test_done
debug log:

solving 9c774872c4e ...
found 9c774872c4e in https://80x24.org/mirrors/git.git

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).