New fast-import test case for valid tree sorting
The Git tree sorting convention is more complex than just the name, it needs to include the mode too to make sure trees sort as though their name ends with "/". This is a simple test case that verifies fast-import keeps the tree ordering correct after editing the same tree twice in a single input stream. A recent proposed patch series (that has not yet been applied) will cause this test to fail, due to a bug in the way the series handles sorting within the trees. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Jeff King committed
Mar 12, 2007 at 14:58 UTC
e7411303861f02a28b76a4c43451c427a3439a5c
1 file changed
+50
t/t9300-fast-import.sh
+50
@@ -501,4 +501,54 @@ test_expect_success \
501
'test `git-rev-parse --verify branch^1` \
502
= `git-rev-parse --verify K^1`'
503
504
+###
505
+### series L
506
+###
507
+
508
+cat >input <<INPUT_END
509
+blob
510
+mark :1
511
+data <<EOF
512
+some data
513
+EOF
514
+
515
+blob
516
+mark :2
517
+data <<EOF
518
+other data
519
+EOF
520
+
521
+commit refs/heads/L
522
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
523
+data <<COMMIT
524
+create L
525
+COMMIT
526
+
527
+M 644 :1 b.
528
+M 644 :1 b/other
529
+M 644 :1 ba
530
+
531
+commit refs/heads/L
532
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
533
+data <<COMMIT
534
+update L
535
+COMMIT
536
+
537
+M 644 :2 b.
538
+M 644 :2 b/other
539
+M 644 :2 ba
540
+INPUT_END
541
+
542
+cat >expect <<EXPECT_END
543
+:100644 100644 4268632... 55d3a52... M b.
544
+:040000 040000 0ae5cac... 443c768... M b
545
+:100644 100644 4268632... 55d3a52... M ba
546
+EXPECT_END
547
+
548
+test_expect_success \
549
+ 'L: verify internal tree sorting' \
550
+ 'git-fast-import <input &&
551
+ git-diff --raw L^ L >output &&
552
+ git diff expect output'
553
+
554
test_done