Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2005 Junio C Hamano |
| 4 | # |
| 5 | |
| 6 | test_description='Test diff raw-output. |
| 7 | |
| 8 | ' |
| 9 | . ./test-lib.sh |
Junio C Hamano | bfdbee9 | 2008-08-08 02:26:28 -0700 | [diff] [blame] | 10 | . "$TEST_DIRECTORY"/lib-read-tree-m-3way.sh |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 11 | |
| 12 | cat >.test-plain-OA <<\EOF |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 13 | :000000 100644 0000000000000000000000000000000000000000 ccba72ad3888a3520b39efcf780b9ee64167535d A AA |
| 14 | :000000 100644 0000000000000000000000000000000000000000 7e426fb079479fd67f6d81f984e4ec649a44bc25 A AN |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 15 | :100644 000000 bcc68ef997017466d5c9094bcf7692295f588c9a 0000000000000000000000000000000000000000 D DD |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 16 | :000000 040000 0000000000000000000000000000000000000000 6d50f65d3bdab91c63444294d38f08aeff328e42 A DF |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 17 | :100644 000000 141c1f1642328e4bc46a7d801a71da392e66791e 0000000000000000000000000000000000000000 D DM |
| 18 | :100644 000000 35abde1506ddf806572ff4d407bd06885d0f8ee9 0000000000000000000000000000000000000000 D DN |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 19 | :000000 100644 0000000000000000000000000000000000000000 1d41122ebdd7a640f29d3c9cc4f9d70094374762 A LL |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 20 | :100644 100644 03f24c8c4700babccfd28b654e7e8eac402ad6cd 103d9f89b50b9aad03054b579be5e7aa665f2d57 M MD |
| 21 | :100644 100644 b258508afb7ceb449981bd9d63d2d3e971bf8d34 b431b272d829ff3aa4d1a5085f4394ab4d3305b6 M MM |
| 22 | :100644 100644 bd084b0c27c7b6cc34f11d6d0509a29be3caf970 a716d58de4a570e0038f5c307bd8db34daea021f M MN |
| 23 | :100644 100644 40c959f984c8b89a2b02520d17f00d717f024397 2ac547ae9614a00d1b28275de608131f7a0e259f M SS |
| 24 | :100644 100644 4ac13458899ab908ef3b1128fa378daefc88d356 4c86f9a85fbc5e6804ee2e17a797538fbe785bca M TT |
| 25 | :040000 040000 7d670fdcdb9929f6c7dac196ff78689cd1c566a1 5e5f22072bb39f6e12cf663a57cb634c76eefb49 M Z |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 26 | EOF |
| 27 | |
| 28 | cat >.test-recursive-OA <<\EOF |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 29 | :000000 100644 0000000000000000000000000000000000000000 ccba72ad3888a3520b39efcf780b9ee64167535d A AA |
| 30 | :000000 100644 0000000000000000000000000000000000000000 7e426fb079479fd67f6d81f984e4ec649a44bc25 A AN |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 31 | :100644 000000 bcc68ef997017466d5c9094bcf7692295f588c9a 0000000000000000000000000000000000000000 D DD |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 32 | :000000 100644 0000000000000000000000000000000000000000 68a6d8b91da11045cf4aa3a5ab9f2a781c701249 A DF/DF |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 33 | :100644 000000 141c1f1642328e4bc46a7d801a71da392e66791e 0000000000000000000000000000000000000000 D DM |
| 34 | :100644 000000 35abde1506ddf806572ff4d407bd06885d0f8ee9 0000000000000000000000000000000000000000 D DN |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 35 | :000000 100644 0000000000000000000000000000000000000000 1d41122ebdd7a640f29d3c9cc4f9d70094374762 A LL |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 36 | :100644 100644 03f24c8c4700babccfd28b654e7e8eac402ad6cd 103d9f89b50b9aad03054b579be5e7aa665f2d57 M MD |
| 37 | :100644 100644 b258508afb7ceb449981bd9d63d2d3e971bf8d34 b431b272d829ff3aa4d1a5085f4394ab4d3305b6 M MM |
| 38 | :100644 100644 bd084b0c27c7b6cc34f11d6d0509a29be3caf970 a716d58de4a570e0038f5c307bd8db34daea021f M MN |
| 39 | :100644 100644 40c959f984c8b89a2b02520d17f00d717f024397 2ac547ae9614a00d1b28275de608131f7a0e259f M SS |
| 40 | :100644 100644 4ac13458899ab908ef3b1128fa378daefc88d356 4c86f9a85fbc5e6804ee2e17a797538fbe785bca M TT |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 41 | :000000 100644 0000000000000000000000000000000000000000 8acb8e9750e3f644bf323fcf3d338849db106c77 A Z/AA |
| 42 | :000000 100644 0000000000000000000000000000000000000000 087494262084cefee7ed484d20c8dc0580791272 A Z/AN |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 43 | :100644 000000 879007efae624d2b1307214b24a956f0a8d686a8 0000000000000000000000000000000000000000 D Z/DD |
| 44 | :100644 000000 9b541b2275c06e3a7b13f28badf5294e2ae63df4 0000000000000000000000000000000000000000 D Z/DM |
| 45 | :100644 000000 beb5d38c55283d280685ea21a0e50cfcc0ca064a 0000000000000000000000000000000000000000 D Z/DN |
| 46 | :100644 100644 d41fda41b7ec4de46b43cb7ea42a45001ae393d5 a79ac3be9377639e1c7d1edf1ae1b3a5f0ccd8a9 M Z/MD |
| 47 | :100644 100644 4ca22bae2527d3d9e1676498a0fba3b355bd1278 61422ba9c2c873416061a88cd40a59a35b576474 M Z/MM |
| 48 | :100644 100644 b16d7b25b869f2beb124efa53467d8a1550ad694 a5c544c21cfcb07eb80a4d89a5b7d1570002edfd M Z/MN |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 49 | EOF |
| 50 | cat >.test-plain-OB <<\EOF |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 51 | :000000 100644 0000000000000000000000000000000000000000 6aa2b5335b16431a0ef71e5c0a28be69183cf6a2 A AA |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 52 | :100644 000000 bcc68ef997017466d5c9094bcf7692295f588c9a 0000000000000000000000000000000000000000 D DD |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 53 | :000000 100644 0000000000000000000000000000000000000000 71420ab81e254145d26d6fc0cddee64c1acd4787 A DF |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 54 | :100644 100644 141c1f1642328e4bc46a7d801a71da392e66791e 3c4d8de5fbad08572bab8e10eef8dbb264cf0231 M DM |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 55 | :000000 100644 0000000000000000000000000000000000000000 1d41122ebdd7a640f29d3c9cc4f9d70094374762 A LL |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 56 | :100644 000000 03f24c8c4700babccfd28b654e7e8eac402ad6cd 0000000000000000000000000000000000000000 D MD |
| 57 | :100644 100644 b258508afb7ceb449981bd9d63d2d3e971bf8d34 19989d4559aae417fedee240ccf2ba315ea4dc2b M MM |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 58 | :000000 100644 0000000000000000000000000000000000000000 15885881ea69115351c09b38371f0348a3fb8c67 A NA |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 59 | :100644 000000 a4e179e4291e5536a5e1c82e091052772d2c5a93 0000000000000000000000000000000000000000 D ND |
| 60 | :100644 100644 c8f25781e8f1792e3e40b74225e20553041b5226 cdb9a8c3da571502ac30225e9c17beccb8387983 M NM |
| 61 | :100644 100644 40c959f984c8b89a2b02520d17f00d717f024397 2ac547ae9614a00d1b28275de608131f7a0e259f M SS |
| 62 | :100644 100644 4ac13458899ab908ef3b1128fa378daefc88d356 c4e4a12231b9fa79a0053cb6077fcb21bb5b135a M TT |
| 63 | :040000 040000 7d670fdcdb9929f6c7dac196ff78689cd1c566a1 1ba523955d5160681af65cb776411f574c1e8155 M Z |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 64 | EOF |
| 65 | cat >.test-recursive-OB <<\EOF |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 66 | :000000 100644 0000000000000000000000000000000000000000 6aa2b5335b16431a0ef71e5c0a28be69183cf6a2 A AA |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 67 | :100644 000000 bcc68ef997017466d5c9094bcf7692295f588c9a 0000000000000000000000000000000000000000 D DD |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 68 | :000000 100644 0000000000000000000000000000000000000000 71420ab81e254145d26d6fc0cddee64c1acd4787 A DF |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 69 | :100644 100644 141c1f1642328e4bc46a7d801a71da392e66791e 3c4d8de5fbad08572bab8e10eef8dbb264cf0231 M DM |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 70 | :000000 100644 0000000000000000000000000000000000000000 1d41122ebdd7a640f29d3c9cc4f9d70094374762 A LL |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 71 | :100644 000000 03f24c8c4700babccfd28b654e7e8eac402ad6cd 0000000000000000000000000000000000000000 D MD |
| 72 | :100644 100644 b258508afb7ceb449981bd9d63d2d3e971bf8d34 19989d4559aae417fedee240ccf2ba315ea4dc2b M MM |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 73 | :000000 100644 0000000000000000000000000000000000000000 15885881ea69115351c09b38371f0348a3fb8c67 A NA |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 74 | :100644 000000 a4e179e4291e5536a5e1c82e091052772d2c5a93 0000000000000000000000000000000000000000 D ND |
| 75 | :100644 100644 c8f25781e8f1792e3e40b74225e20553041b5226 cdb9a8c3da571502ac30225e9c17beccb8387983 M NM |
| 76 | :100644 100644 40c959f984c8b89a2b02520d17f00d717f024397 2ac547ae9614a00d1b28275de608131f7a0e259f M SS |
| 77 | :100644 100644 4ac13458899ab908ef3b1128fa378daefc88d356 c4e4a12231b9fa79a0053cb6077fcb21bb5b135a M TT |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 78 | :000000 100644 0000000000000000000000000000000000000000 6c0b99286d0bce551ac4a7b3dff8b706edff3715 A Z/AA |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 79 | :100644 000000 879007efae624d2b1307214b24a956f0a8d686a8 0000000000000000000000000000000000000000 D Z/DD |
| 80 | :100644 100644 9b541b2275c06e3a7b13f28badf5294e2ae63df4 d77371d15817fcaa57eeec27f770c505ba974ec1 M Z/DM |
| 81 | :100644 000000 d41fda41b7ec4de46b43cb7ea42a45001ae393d5 0000000000000000000000000000000000000000 D Z/MD |
| 82 | :100644 100644 4ca22bae2527d3d9e1676498a0fba3b355bd1278 697aad7715a1e7306ca76290a3dd4208fbaeddfa M Z/MM |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 83 | :000000 100644 0000000000000000000000000000000000000000 d12979c22fff69c59ca9409e7a8fe3ee25eaee80 A Z/NA |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 84 | :100644 000000 a18393c636b98e9bd7296b8b437ea4992b72440c 0000000000000000000000000000000000000000 D Z/ND |
| 85 | :100644 100644 3fdbe17fd013303a2e981e1ca1c6cd6e72789087 7e09d6a3a14bd630913e8c75693cea32157b606d M Z/NM |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 86 | EOF |
| 87 | cat >.test-plain-AB <<\EOF |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 88 | :100644 100644 ccba72ad3888a3520b39efcf780b9ee64167535d 6aa2b5335b16431a0ef71e5c0a28be69183cf6a2 M AA |
| 89 | :100644 000000 7e426fb079479fd67f6d81f984e4ec649a44bc25 0000000000000000000000000000000000000000 D AN |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 90 | :000000 100644 0000000000000000000000000000000000000000 71420ab81e254145d26d6fc0cddee64c1acd4787 A DF |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 91 | :040000 000000 6d50f65d3bdab91c63444294d38f08aeff328e42 0000000000000000000000000000000000000000 D DF |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 92 | :000000 100644 0000000000000000000000000000000000000000 3c4d8de5fbad08572bab8e10eef8dbb264cf0231 A DM |
| 93 | :000000 100644 0000000000000000000000000000000000000000 35abde1506ddf806572ff4d407bd06885d0f8ee9 A DN |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 94 | :100644 000000 103d9f89b50b9aad03054b579be5e7aa665f2d57 0000000000000000000000000000000000000000 D MD |
| 95 | :100644 100644 b431b272d829ff3aa4d1a5085f4394ab4d3305b6 19989d4559aae417fedee240ccf2ba315ea4dc2b M MM |
| 96 | :100644 100644 a716d58de4a570e0038f5c307bd8db34daea021f bd084b0c27c7b6cc34f11d6d0509a29be3caf970 M MN |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 97 | :000000 100644 0000000000000000000000000000000000000000 15885881ea69115351c09b38371f0348a3fb8c67 A NA |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 98 | :100644 000000 a4e179e4291e5536a5e1c82e091052772d2c5a93 0000000000000000000000000000000000000000 D ND |
| 99 | :100644 100644 c8f25781e8f1792e3e40b74225e20553041b5226 cdb9a8c3da571502ac30225e9c17beccb8387983 M NM |
| 100 | :100644 100644 4c86f9a85fbc5e6804ee2e17a797538fbe785bca c4e4a12231b9fa79a0053cb6077fcb21bb5b135a M TT |
| 101 | :040000 040000 5e5f22072bb39f6e12cf663a57cb634c76eefb49 1ba523955d5160681af65cb776411f574c1e8155 M Z |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 102 | EOF |
| 103 | cat >.test-recursive-AB <<\EOF |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 104 | :100644 100644 ccba72ad3888a3520b39efcf780b9ee64167535d 6aa2b5335b16431a0ef71e5c0a28be69183cf6a2 M AA |
| 105 | :100644 000000 7e426fb079479fd67f6d81f984e4ec649a44bc25 0000000000000000000000000000000000000000 D AN |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 106 | :000000 100644 0000000000000000000000000000000000000000 71420ab81e254145d26d6fc0cddee64c1acd4787 A DF |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 107 | :100644 000000 68a6d8b91da11045cf4aa3a5ab9f2a781c701249 0000000000000000000000000000000000000000 D DF/DF |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 108 | :000000 100644 0000000000000000000000000000000000000000 3c4d8de5fbad08572bab8e10eef8dbb264cf0231 A DM |
| 109 | :000000 100644 0000000000000000000000000000000000000000 35abde1506ddf806572ff4d407bd06885d0f8ee9 A DN |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 110 | :100644 000000 103d9f89b50b9aad03054b579be5e7aa665f2d57 0000000000000000000000000000000000000000 D MD |
| 111 | :100644 100644 b431b272d829ff3aa4d1a5085f4394ab4d3305b6 19989d4559aae417fedee240ccf2ba315ea4dc2b M MM |
| 112 | :100644 100644 a716d58de4a570e0038f5c307bd8db34daea021f bd084b0c27c7b6cc34f11d6d0509a29be3caf970 M MN |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 113 | :000000 100644 0000000000000000000000000000000000000000 15885881ea69115351c09b38371f0348a3fb8c67 A NA |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 114 | :100644 000000 a4e179e4291e5536a5e1c82e091052772d2c5a93 0000000000000000000000000000000000000000 D ND |
| 115 | :100644 100644 c8f25781e8f1792e3e40b74225e20553041b5226 cdb9a8c3da571502ac30225e9c17beccb8387983 M NM |
| 116 | :100644 100644 4c86f9a85fbc5e6804ee2e17a797538fbe785bca c4e4a12231b9fa79a0053cb6077fcb21bb5b135a M TT |
| 117 | :100644 100644 8acb8e9750e3f644bf323fcf3d338849db106c77 6c0b99286d0bce551ac4a7b3dff8b706edff3715 M Z/AA |
| 118 | :100644 000000 087494262084cefee7ed484d20c8dc0580791272 0000000000000000000000000000000000000000 D Z/AN |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 119 | :000000 100644 0000000000000000000000000000000000000000 d77371d15817fcaa57eeec27f770c505ba974ec1 A Z/DM |
| 120 | :000000 100644 0000000000000000000000000000000000000000 beb5d38c55283d280685ea21a0e50cfcc0ca064a A Z/DN |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 121 | :100644 000000 a79ac3be9377639e1c7d1edf1ae1b3a5f0ccd8a9 0000000000000000000000000000000000000000 D Z/MD |
| 122 | :100644 100644 61422ba9c2c873416061a88cd40a59a35b576474 697aad7715a1e7306ca76290a3dd4208fbaeddfa M Z/MM |
| 123 | :100644 100644 a5c544c21cfcb07eb80a4d89a5b7d1570002edfd b16d7b25b869f2beb124efa53467d8a1550ad694 M Z/MN |
Junio C Hamano | 2bbcdde | 2005-07-26 00:22:43 -0700 | [diff] [blame] | 124 | :000000 100644 0000000000000000000000000000000000000000 d12979c22fff69c59ca9409e7a8fe3ee25eaee80 A Z/NA |
Junio C Hamano | b6d8f30 | 2005-05-23 14:55:33 -0700 | [diff] [blame] | 125 | :100644 000000 a18393c636b98e9bd7296b8b437ea4992b72440c 0000000000000000000000000000000000000000 D Z/ND |
| 126 | :100644 100644 3fdbe17fd013303a2e981e1ca1c6cd6e72789087 7e09d6a3a14bd630913e8c75693cea32157b606d M Z/NM |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 127 | EOF |
| 128 | |
Junio C Hamano | 4117469 | 2005-05-20 09:48:38 -0700 | [diff] [blame] | 129 | cmp_diff_files_output () { |
| 130 | # diff-files never reports additions. Also it does not fill in the |
| 131 | # object ID for the changed files because it wants you to look at the |
| 132 | # filesystem. |
| 133 | sed <"$2" >.test-tmp \ |
Junio C Hamano | 3749fde | 2011-04-23 22:34:13 -0700 | [diff] [blame] | 134 | -e '/^:000000 /d;s/'$_x40'\( [MCRNDU][0-9]*\) /'$_z40'\1 /' && |
Gary V. Vaughan | 4fdf71b | 2010-05-14 09:31:37 +0000 | [diff] [blame] | 135 | test_cmp "$1" .test-tmp |
Junio C Hamano | 4117469 | 2005-05-20 09:48:38 -0700 | [diff] [blame] | 136 | } |
| 137 | |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 138 | test_expect_success \ |
| 139 | 'diff-tree of known trees.' \ |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 140 | 'git diff-tree $tree_O $tree_A >.test-a && |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 141 | cmp -s .test-a .test-plain-OA' |
| 142 | |
| 143 | test_expect_success \ |
| 144 | 'diff-tree of known trees.' \ |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 145 | 'git diff-tree -r $tree_O $tree_A >.test-a && |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 146 | cmp -s .test-a .test-recursive-OA' |
| 147 | |
| 148 | test_expect_success \ |
| 149 | 'diff-tree of known trees.' \ |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 150 | 'git diff-tree $tree_O $tree_B >.test-a && |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 151 | cmp -s .test-a .test-plain-OB' |
| 152 | |
| 153 | test_expect_success \ |
| 154 | 'diff-tree of known trees.' \ |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 155 | 'git diff-tree -r $tree_O $tree_B >.test-a && |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 156 | cmp -s .test-a .test-recursive-OB' |
| 157 | |
| 158 | test_expect_success \ |
| 159 | 'diff-tree of known trees.' \ |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 160 | 'git diff-tree $tree_A $tree_B >.test-a && |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 161 | cmp -s .test-a .test-plain-AB' |
| 162 | |
| 163 | test_expect_success \ |
| 164 | 'diff-tree of known trees.' \ |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 165 | 'git diff-tree -r $tree_A $tree_B >.test-a && |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 166 | cmp -s .test-a .test-recursive-AB' |
| 167 | |
Junio C Hamano | 4117469 | 2005-05-20 09:48:38 -0700 | [diff] [blame] | 168 | test_expect_success \ |
Karl Hasselström | 5bf707c | 2008-08-10 18:13:04 +0200 | [diff] [blame] | 169 | 'diff-tree --stdin of known trees.' \ |
| 170 | 'echo $tree_A $tree_B | git diff-tree --stdin > .test-a && |
| 171 | echo $tree_A $tree_B > .test-plain-ABx && |
| 172 | cat .test-plain-AB >> .test-plain-ABx && |
| 173 | cmp -s .test-a .test-plain-ABx' |
| 174 | |
| 175 | test_expect_success \ |
| 176 | 'diff-tree --stdin of known trees.' \ |
| 177 | 'echo $tree_A $tree_B | git diff-tree -r --stdin > .test-a && |
| 178 | echo $tree_A $tree_B > .test-recursive-ABx && |
| 179 | cat .test-recursive-AB >> .test-recursive-ABx && |
| 180 | cmp -s .test-a .test-recursive-ABx' |
| 181 | |
| 182 | test_expect_success \ |
Junio C Hamano | 4117469 | 2005-05-20 09:48:38 -0700 | [diff] [blame] | 183 | 'diff-cache O with A in cache' \ |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 184 | 'git read-tree $tree_A && |
| 185 | git diff-index --cached $tree_O >.test-a && |
Junio C Hamano | 4117469 | 2005-05-20 09:48:38 -0700 | [diff] [blame] | 186 | cmp -s .test-a .test-recursive-OA' |
| 187 | |
| 188 | test_expect_success \ |
| 189 | 'diff-cache O with B in cache' \ |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 190 | 'git read-tree $tree_B && |
| 191 | git diff-index --cached $tree_O >.test-a && |
Junio C Hamano | 4117469 | 2005-05-20 09:48:38 -0700 | [diff] [blame] | 192 | cmp -s .test-a .test-recursive-OB' |
| 193 | |
| 194 | test_expect_success \ |
| 195 | 'diff-cache A with B in cache' \ |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 196 | 'git read-tree $tree_B && |
| 197 | git diff-index --cached $tree_A >.test-a && |
Junio C Hamano | 4117469 | 2005-05-20 09:48:38 -0700 | [diff] [blame] | 198 | cmp -s .test-a .test-recursive-AB' |
| 199 | |
| 200 | test_expect_success \ |
| 201 | 'diff-files with O in cache and A checked out' \ |
| 202 | 'rm -fr Z [A-Z][A-Z] && |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 203 | git read-tree $tree_A && |
| 204 | git checkout-index -f -a && |
Elijah Newren | b62b343 | 2010-10-03 14:00:03 -0600 | [diff] [blame] | 205 | git read-tree --reset $tree_O && |
| 206 | test_must_fail git update-index --refresh -q && |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 207 | git diff-files >.test-a && |
Junio C Hamano | 4117469 | 2005-05-20 09:48:38 -0700 | [diff] [blame] | 208 | cmp_diff_files_output .test-a .test-recursive-OA' |
| 209 | |
| 210 | test_expect_success \ |
| 211 | 'diff-files with O in cache and B checked out' \ |
| 212 | 'rm -fr Z [A-Z][A-Z] && |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 213 | git read-tree $tree_B && |
| 214 | git checkout-index -f -a && |
Elijah Newren | b62b343 | 2010-10-03 14:00:03 -0600 | [diff] [blame] | 215 | git read-tree --reset $tree_O && |
| 216 | test_must_fail git update-index --refresh -q && |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 217 | git diff-files >.test-a && |
Junio C Hamano | 4117469 | 2005-05-20 09:48:38 -0700 | [diff] [blame] | 218 | cmp_diff_files_output .test-a .test-recursive-OB' |
| 219 | |
| 220 | test_expect_success \ |
| 221 | 'diff-files with A in cache and B checked out' \ |
| 222 | 'rm -fr Z [A-Z][A-Z] && |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 223 | git read-tree $tree_B && |
| 224 | git checkout-index -f -a && |
Elijah Newren | b62b343 | 2010-10-03 14:00:03 -0600 | [diff] [blame] | 225 | git read-tree --reset $tree_A && |
| 226 | test_must_fail git update-index --refresh -q && |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 227 | git diff-files >.test-a && |
Junio C Hamano | 4117469 | 2005-05-20 09:48:38 -0700 | [diff] [blame] | 228 | cmp_diff_files_output .test-a .test-recursive-AB' |
| 229 | |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 230 | ################################################################ |
| 231 | # Now we have established the baseline, we do not have to |
| 232 | # rely on individual object ID values that much. |
| 233 | |
| 234 | test_expect_success \ |
| 235 | 'diff-tree O A == diff-tree -R A O' \ |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 236 | 'git diff-tree $tree_O $tree_A >.test-a && |
| 237 | git diff-tree -R $tree_A $tree_O >.test-b && |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 238 | cmp -s .test-a .test-b' |
| 239 | |
| 240 | test_expect_success \ |
| 241 | 'diff-tree -r O A == diff-tree -r -R A O' \ |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 242 | 'git diff-tree -r $tree_O $tree_A >.test-a && |
| 243 | git diff-tree -r -R $tree_A $tree_O >.test-b && |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 244 | cmp -s .test-a .test-b' |
| 245 | |
| 246 | test_expect_success \ |
| 247 | 'diff-tree B A == diff-tree -R A B' \ |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 248 | 'git diff-tree $tree_B $tree_A >.test-a && |
| 249 | git diff-tree -R $tree_A $tree_B >.test-b && |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 250 | cmp -s .test-a .test-b' |
| 251 | |
| 252 | test_expect_success \ |
| 253 | 'diff-tree -r B A == diff-tree -r -R A B' \ |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 254 | 'git diff-tree -r $tree_B $tree_A >.test-a && |
| 255 | git diff-tree -r -R $tree_A $tree_B >.test-b && |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 256 | cmp -s .test-a .test-b' |
| 257 | |
Thomas Rast | 85569d7 | 2009-02-19 12:13:36 +0100 | [diff] [blame] | 258 | test_expect_success \ |
| 259 | 'diff can read from stdin' \ |
| 260 | 'test_must_fail git diff --no-index -- MN - < NN | |
| 261 | grep -v "^index" | sed "s#/-#/NN#" >.test-a && |
| 262 | test_must_fail git diff --no-index -- MN NN | |
| 263 | grep -v "^index" >.test-b && |
| 264 | test_cmp .test-a .test-b' |
| 265 | |
Junio C Hamano | 6371302 | 2005-05-20 08:32:07 -0700 | [diff] [blame] | 266 | test_done |