t3200: test -l with core.logAllRefUpdates options
By default reflogs are always created for new local branches by "checkout -b". But by setting core.logAllRefUpdates to false this will not be true anymore. In that case you only create the reflogs when you use -l switch with "checkout -b". Added missing tests to check expected behaviors. Signed-off-by: Erick Mattos <erick.mattos@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Erick Mattos committed
May 21, 2010 at 21:28 UTC
b2099957752071fec70502c81206364ac986073a
1 file changed
+24
t/t3200-branch.sh
+24
@@ -224,6 +224,30 @@ test_expect_success \
224
test -f .git/logs/refs/heads/g/h/i &&
225
diff expect .git/logs/refs/heads/g/h/i'
226
227
+test_expect_success 'checkout -b makes reflog by default' '
228
+ git checkout master &&
229
+ git config --unset core.logAllRefUpdates &&
230
+ git checkout -b alpha &&
231
+ test -f .git/logs/refs/heads/alpha &&
232
+ PAGER= git reflog show alpha
233
+'
234
+
235
+test_expect_success 'checkout -b does not make reflog when core.logAllRefUpdates = false' '
236
+ git checkout master &&
237
+ git config core.logAllRefUpdates false &&
238
+ git checkout -b beta &&
239
+ ! test -f .git/logs/refs/heads/beta &&
240
+ test_must_fail PAGER= git reflog show beta
241
+'
242
+
243
+test_expect_success 'checkout -b with -l makes reflog when core.logAllRefUpdates = false' '
244
+ git checkout master &&
245
+ git checkout -lb gamma &&
246
+ git config --unset core.logAllRefUpdates &&
247
+ test -f .git/logs/refs/heads/gamma &&
248
+ PAGER= git reflog show gamma
249
+'
250
+
251
test_expect_success 'avoid ambiguous track' '
252
git config branch.autosetupmerge true &&
253
git config remote.ambi1.url lalala &&