git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
67dd96b93212a3de41d94808903782ed244f4843 blob 797 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
 
#!/bin/sh

test_description='verify safe.directory checks while running as root'

. ./test-lib.sh

# this prerequisite should be added to all the tests, it not only prevents
# the test from failing but also warms up any authentication cache sudo
# might need to avoid asking for a password
test_lazy_prereq SUDO '
	sudo -n id -u >u &&
	id -u root >r &&
	test_cmp u r &&
	command -v git >u &&
	sudo command -v git >r &&
	test_cmp u r
'

test_expect_success SUDO 'setup' '
	sudo rm -rf root &&
	mkdir -p root/r &&
	sudo chown root root &&
	(
		cd root/r &&
		git init
	)
'

test_expect_success SUDO 'sudo git status as original owner' '
	(
		cd root/r &&
		git status &&
		sudo git status
	)
'

# this MUST be always the last test
test_expect_success SUDO 'cleanup' '
	sudo rm -rf root
'

test_done
debug log:

solving 67dd96b9321 ...
found 67dd96b9321 in https://public-inbox.org/git/20220502183920.88982-3-carenas@gmail.com/
found bec73fe3c10 in https://public-inbox.org/git/20220502183920.88982-2-carenas@gmail.com/

applying [1/2] https://public-inbox.org/git/20220502183920.88982-2-carenas@gmail.com/
diff --git a/t/t0034-root-safe-directory.sh b/t/t0034-root-safe-directory.sh
new file mode 100755
index 00000000000..bec73fe3c10


applying [2/2] https://public-inbox.org/git/20220502183920.88982-3-carenas@gmail.com/
diff --git a/t/t0034-root-safe-directory.sh b/t/t0034-root-safe-directory.sh
index bec73fe3c10..67dd96b9321 100755

Checking patch t/t0034-root-safe-directory.sh...
Applied patch t/t0034-root-safe-directory.sh cleanly.
Checking patch t/t0034-root-safe-directory.sh...
Applied patch t/t0034-root-safe-directory.sh cleanly.

index at:
100755 67dd96b93212a3de41d94808903782ed244f4843	t/t0034-root-safe-directory.sh

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).