summaryrefslogtreecommitdiff
path: root/t/t5527-fetch-odd-refs.sh
blob: edea9f957e4034098faeb51dec59e9661af8e29e (plain)
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
#!/bin/sh
 
test_description='test fetching of oddly-named refs'
. ./test-lib.sh
 
# afterwards we will have:
#  HEAD - two
#  refs/for/refs/heads/master - one
#  refs/heads/master - three
test_expect_success 'setup repo with odd suffix ref' '
	echo content >file &&
	git add . &&
	git commit -m one &&
	git update-ref refs/for/refs/heads/master HEAD &&
	echo content >>file &&
	git commit -a -m two &&
	echo content >>file &&
	git commit -a -m three &&
	git checkout HEAD^
'
 
test_expect_success 'suffix ref is ignored during fetch' '
	git clone --bare file://"$PWD" suffix &&
	echo three >expect &&
	git --git-dir=suffix log -1 --format=%s refs/heads/master >actual &&
	test_cmp expect actual
'
 
test_done