git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
c730600d8a78c537e52bdf6acc9798a6809b6295 blob 1556 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
60
61
62
63
64
65
66
67
68
69
70
 
#!/bin/sh

test_description='Test reflog interaction with detached HEAD'
. ./test-lib.sh

reset_state () {
	git checkout master &&
	cp saved_reflog .git/logs/HEAD
}

test_expect_success setup '
	test_tick &&
	git commit --allow-empty -m initial &&
	git branch side &&
	test_tick &&
	git commit --allow-empty -m second &&
	cat .git/logs/HEAD >saved_reflog
'

test_expect_success baseline '
	reset_state &&
	git rev-parse master master^ >expect &&
	git log -g --format=%H >actual &&
	test_cmp expect actual
'

test_expect_success 'switch to branch' '
	reset_state &&
	git rev-parse side master master^ >expect &&
	git checkout side &&
	git log -g --format=%H >actual &&
	test_cmp expect actual
'

test_expect_success 'detach to other' '
	reset_state &&
	git rev-parse master side master master^ >expect &&
	git checkout side &&
	git checkout master^0 &&
	git log -g --format=%H >actual &&
	test_cmp expect actual
'

test_expect_success 'detach to self' '
	reset_state &&
	git rev-parse master master master^ >expect &&
	git checkout master^0 &&
	git log -g --format=%H >actual &&
	test_cmp expect actual
'

test_expect_success 'attach to self' '
	reset_state &&
	git rev-parse master master master master^ >expect &&
	git checkout master^0 &&
	git checkout master &&
	git log -g --format=%H >actual &&
	test_cmp expect actual
'

test_expect_success 'attach to other' '
	reset_state &&
	git rev-parse side master master master^ >expect &&
	git checkout master^0 &&
	git checkout side &&
	git log -g --format=%H >actual &&
	test_cmp expect actual
'

test_done
debug log:

solving c730600d8a ...
found c730600d8a 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).