Merge branch 'kh/diff-tree'
authorJunio C Hamano <gitster@pobox.com>
Thu, 21 Aug 2008 06:41:59 +0000 (23:41 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 Aug 2008 06:41:59 +0000 (23:41 -0700)
* kh/diff-tree:
Add test for diff-tree --stdin with two trees
Teach git diff-tree --stdin to diff trees
diff-tree: Note that the commit ID is printed with --stdin
Refactoring: Split up diff_tree_stdin

1  2 
t/t4002-diff-basic.sh
diff --combined t/t4002-diff-basic.sh
index 56bd3c2be1d7a2ae21e419bb5f6184ba0bf83ff9,27743c4c5973798ca7ae511a8c4610b17fe848a8..cc3681f16118ca70ae9f65a27ccd6f354a6deee1
@@@ -7,7 -7,7 +7,7 @@@ test_description='Test diff raw-output
  
  '
  . ./test-lib.sh
 -. ../lib-read-tree-m-3way.sh
 +. "$TEST_DIRECTORY"/lib-read-tree-m-3way.sh
  
  cat >.test-plain-OA <<\EOF
  :000000 100644 0000000000000000000000000000000000000000 ccba72ad3888a3520b39efcf780b9ee64167535d A    AA
@@@ -168,6 -168,20 +168,20 @@@ test_expect_success 
      'git diff-tree -r $tree_A $tree_B >.test-a &&
       cmp -s .test-a .test-recursive-AB'
  
+ test_expect_success \
+     'diff-tree --stdin of known trees.' \
+     'echo $tree_A $tree_B | git diff-tree --stdin > .test-a &&
+      echo $tree_A $tree_B > .test-plain-ABx &&
+      cat .test-plain-AB >> .test-plain-ABx &&
+      cmp -s .test-a .test-plain-ABx'
+ test_expect_success \
+     'diff-tree --stdin of known trees.' \
+     'echo $tree_A $tree_B | git diff-tree -r --stdin > .test-a &&
+      echo $tree_A $tree_B > .test-recursive-ABx &&
+      cat .test-recursive-AB >> .test-recursive-ABx &&
+      cmp -s .test-a .test-recursive-ABx'
  test_expect_success \
      'diff-cache O with A in cache' \
      'git read-tree $tree_A &&