git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
94bdfbd69cb2b7fc123f9a0c718554ea8a8bc365 blob 4015 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
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
 
#!/bin/sh

test_description='git rebase + directory rename tests'

. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-rebase.sh

test_expect_success 'setup testcase where directory rename should be detected' '
	test_create_repo dir-rename &&
	(
		cd dir-rename &&

		mkdir x &&
		test_seq  1 10 >x/a &&
		test_seq 11 20 >x/b &&
		test_seq 21 30 >x/c &&
		test_write_lines a b c d e f g h i >l &&
		git add x l &&
		git commit -m "Initial" &&

		git branch O &&
		git branch A &&
		git branch B &&

		git checkout A &&
		git mv x y &&
		git mv l letters &&
		git commit -m "Rename x to y, l to letters" &&

		git checkout B &&
		echo j >>l &&
		test_seq 31 40 >x/d &&
		git add l x/d &&
		git commit -m "Modify l, add x/d"
	)
'

test_expect_success 'rebase --interactive: directory rename detected' '
	(
		cd dir-rename &&

		git checkout B^0 &&

		set_fake_editor &&
		FAKE_LINES="1" git rebase --interactive A &&

		git ls-files -s >out &&
		test_line_count = 5 out &&

		test_path_is_file y/d &&
		test_path_is_missing x/d
	)
'

test_expect_failure 'rebase (am): directory rename detected' '
	(
		cd dir-rename &&

		git checkout B^0 &&

		git rebase A &&

		git ls-files -s >out &&
		test_line_count = 5 out &&

		test_path_is_file y/d &&
		test_path_is_missing x/d
	)
'

test_expect_success 'rebase --merge: directory rename detected' '
	(
		cd dir-rename &&

		git checkout B^0 &&

		git rebase --merge A &&

		git ls-files -s >out &&
		test_line_count = 5 out &&

		test_path_is_file y/d &&
		test_path_is_missing x/d
	)
'

test_expect_failure 'am: directory rename detected' '
	(
		cd dir-rename &&

		git checkout A^0 &&

		git format-patch -1 B &&

		git am --3way 0001*.patch &&

		git ls-files -s >out &&
		test_line_count = 5 out &&

		test_path_is_file y/d &&
		test_path_is_missing x/d
	)
'

test_expect_success 'setup testcase where directory rename should NOT be detected' '
	test_create_repo no-dir-rename &&
	(
		cd no-dir-rename &&

		mkdir x &&
		test_seq  1 10 >x/a &&
		test_seq 11 20 >x/b &&
		test_seq 21 30 >x/c &&
		echo original >project_info &&
		git add x project_info &&
		git commit -m "Initial" &&

		git branch O &&
		git branch A &&
		git branch B &&

		git checkout A &&
		echo v2 >project_info &&
		git add project_info &&
		git commit -m "Modify project_info" &&

		git checkout B &&
		mkdir y &&
		git mv x/c y/c &&
		echo v1 >project_info &&
		git add project_info &&
		git commit -m "Rename x/c to y/c, modify project_info"
	)
'

test_expect_success 'rebase --interactive: NO directory rename' '
	test_when_finished "git -C no-dir-rename rebase --abort" &&
	(
		cd no-dir-rename &&

		git checkout B^0 &&

		set_fake_editor &&
		FAKE_LINES="1" test_must_fail git rebase --interactive A &&

		git ls-files -s >out &&
		test_line_count = 6 out &&

		test_path_is_file x/a &&
		test_path_is_file x/b &&
		test_path_is_missing x/c
	)
'

test_expect_success 'rebase (am): NO directory rename' '
	test_when_finished "git -C no-dir-rename rebase --abort" &&
	(
		cd no-dir-rename &&

		git checkout B^0 &&

		set_fake_editor &&
		FAKE_LINES="1" test_must_fail git rebase A &&

		git ls-files -s >out &&
		test_line_count = 6 out &&

		test_path_is_file x/a &&
		test_path_is_file x/b &&
		test_path_is_missing x/c
	)
'

test_expect_success 'rebase --merge: NO directory rename' '
	test_when_finished "git -C no-dir-rename rebase --abort" &&
	(
		cd no-dir-rename &&

		git checkout B^0 &&

		set_fake_editor &&
		FAKE_LINES="1" test_must_fail git rebase --merge A &&

		git ls-files -s >out &&
		test_line_count = 6 out &&

		test_path_is_file x/a &&
		test_path_is_file x/b &&
		test_path_is_missing x/c
	)
'

test_expect_success 'am: NO directory rename' '
	test_when_finished "git -C no-dir-rename am --abort" &&
	(
		cd no-dir-rename &&

		git checkout A^0 &&

		git format-patch -1 B &&

		test_must_fail git am --3way 0001*.patch &&

		git ls-files -s >out &&
		test_line_count = 6 out &&

		test_path_is_file x/a &&
		test_path_is_file x/b &&
		test_path_is_missing x/c
	)
'

test_done
debug log:

solving 94bdfbd69c ...
found 94bdfbd69c in https://public-inbox.org/git/20180829070613.11793-4-newren@gmail.com/
found a87df9e675 in https://public-inbox.org/git/20180829070613.11793-2-newren@gmail.com/
found 8f832957fc in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100755 8f832957fc38110b7653ad0a058172ed9fc8bf1f	t/t3401-rebase-and-am-rename.sh

applying [1/2] https://public-inbox.org/git/20180829070613.11793-2-newren@gmail.com/
diff --git a/t/t3401-rebase-and-am-rename.sh b/t/t3401-rebase-and-am-rename.sh
index 8f832957fc..a87df9e675 100755


applying [2/2] https://public-inbox.org/git/20180829070613.11793-4-newren@gmail.com/
diff --git a/t/t3401-rebase-and-am-rename.sh b/t/t3401-rebase-and-am-rename.sh
index a87df9e675..94bdfbd69c 100755

Checking patch t/t3401-rebase-and-am-rename.sh...
Applied patch t/t3401-rebase-and-am-rename.sh cleanly.
Checking patch t/t3401-rebase-and-am-rename.sh...
Applied patch t/t3401-rebase-and-am-rename.sh cleanly.

index at:
100755 94bdfbd69cb2b7fc123f9a0c718554ea8a8bc365	t/t3401-rebase-and-am-rename.sh

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git