@@ -318,6 +318,52 @@ load 'common'
318
318
assert_equal " $( git -C git-repo show master:dir-a/.gitignore) " ' /ignore-a'
319
319
}
320
320
321
+ @test ' deleting last file from root should not add empty .gitignore with empty-dirs-parameter' {
322
+ touch file-a
323
+ svn add file-a
324
+ svn commit -m ' add file-a'
325
+ svn rm file-a
326
+ svn commit -m ' delete file-a'
327
+
328
+ cd " $TEST_TEMP_DIR "
329
+ svn2git " $SVN_REPO " --empty-dirs --rules <( echo "
330
+ create repository git-repo
331
+ end repository
332
+
333
+ match /
334
+ repository git-repo
335
+ branch master
336
+ end match
337
+ " )
338
+
339
+ refute git -C git-repo show master:.gitignore
340
+ refute git -C git-repo show master:file-a/.gitignore
341
+ }
342
+
343
+ @test ' deleting last file from root should not add empty .gitignore with empty-dirs-parameter (nested)' {
344
+ svn mkdir project-a
345
+ cd project-a
346
+ touch file-a
347
+ svn add file-a
348
+ svn commit -m ' add file-a'
349
+ svn rm file-a
350
+ svn commit -m ' delete file-a'
351
+
352
+ cd " $TEST_TEMP_DIR "
353
+ svn2git " $SVN_REPO " --empty-dirs --rules <( echo "
354
+ create repository git-repo
355
+ end repository
356
+
357
+ match /project-a/
358
+ repository git-repo
359
+ branch master
360
+ end match
361
+ " )
362
+
363
+ refute git -C git-repo show master:.gitignore
364
+ refute git -C git-repo show master:file-a/.gitignore
365
+ }
366
+
321
367
@test ' deleting last directory from a directory should add empty .gitignore with empty-dirs-parameter' {
322
368
svn mkdir --parents dir-a/subdir-a
323
369
svn commit -m ' add dir-a/subdir-a'
@@ -414,6 +460,50 @@ load 'common'
414
460
assert_equal " $( git -C git-repo show master:dir-a/.gitignore) " ' /ignore-a'
415
461
}
416
462
463
+ @test ' deleting last directory from root should not add empty .gitignore with empty-dirs-parameter' {
464
+ svn mkdir dir-a
465
+ svn commit -m ' add dir-a'
466
+ svn rm dir-a
467
+ svn commit -m ' delete dir-a'
468
+
469
+ cd " $TEST_TEMP_DIR "
470
+ svn2git " $SVN_REPO " --empty-dirs --rules <( echo "
471
+ create repository git-repo
472
+ end repository
473
+
474
+ match /
475
+ repository git-repo
476
+ branch master
477
+ end match
478
+ " )
479
+
480
+ refute git -C git-repo show master:.gitignore
481
+ refute git -C git-repo show master:dir-a/.gitignore
482
+ }
483
+
484
+ @test ' deleting last directory from root should not add empty .gitignore with empty-dirs-parameter (nested)' {
485
+ svn mkdir project-a
486
+ cd project-a
487
+ svn mkdir dir-a
488
+ svn commit -m ' add dir-a'
489
+ svn rm dir-a
490
+ svn commit -m ' delete dir-a'
491
+
492
+ cd " $TEST_TEMP_DIR "
493
+ svn2git " $SVN_REPO " --empty-dirs --rules <( echo "
494
+ create repository git-repo
495
+ end repository
496
+
497
+ match /project-a/
498
+ repository git-repo
499
+ branch master
500
+ end match
501
+ " )
502
+
503
+ refute git -C git-repo show master:.gitignore
504
+ refute git -C git-repo show master:dir-a/.gitignore
505
+ }
506
+
417
507
@test ' copying an empty directory should put empty .gitignore file to copy with empty-dirs parameter' {
418
508
svn mkdir dir-a
419
509
svn commit -m ' add dir-a'
0 commit comments