From 0d9e0323a552078a6bec639f2c715b3d9f267922 Mon Sep 17 00:00:00 2001 From: "Scott J. Goldman" Date: Tue, 27 Nov 2012 23:27:41 -0800 Subject: [PATCH] Add the ahead/behind test that Carlos suggested Adds a repo with a more complex topology to test the ahead-behind count. --- tests-clar/resources/twowaymerge.git/HEAD | 1 + tests-clar/resources/twowaymerge.git/config | 5 + .../resources/twowaymerge.git/description | 1 + .../resources/twowaymerge.git/info/exclude | 6 + .../0c/8a3f1f3d5f421cf83048c7c73ee3b55a5e0f29 | Bin 0 -> 157 bytes .../10/2dce8e3081f398e4bdd9fd894dc85ac3ca6a67 | Bin 0 -> 54 bytes .../17/7d8634a28e26ec7819284752757ebe01a479d5 | Bin 0 -> 80 bytes .../1c/30b88f5f3ee66d78df6520a7de9e89b890818b | 3 + .../1f/4c0311a24b63f6fc209a59a1e404942d4a5006 | 2 + .../22/24e191514cb4bd8c566d80dac22dfcb1e9bb83 | 3 + .../29/6e56023cdc034d2735fee8c0d85a659d1b07f4 | Bin 0 -> 51 bytes .../31/51880ae2b363f1c262cf98b750c1f169a0d432 | Bin 0 -> 68 bytes .../3b/287f8730c81d0b763c2d294618a5e32b67b4f8 | Bin 0 -> 54 bytes .../42/b7311aa626e712891940c1ec5d5cba201946a4 | 3 + .../49/6d6428b9cf92981dc9495211e6e1120fb6f2ba | Bin 0 -> 46 bytes .../59/b0cf7d74659e1cdb13305319d6d4ce2733c118 | Bin 0 -> 65 bytes .../6a/b5d28acbf3c3bdff276f7ccfdf29c1520e542f | 1 + .../6c/fca542b55b8b37017e6125a4b8f59a6eae6f11 | Bin 0 -> 68 bytes .../76/5b32c65d38f04c4f287abda055818ec0f26912 | Bin 0 -> 54 bytes .../7b/8c336c45fc6895c1c60827260fe5d798e5d247 | 3 + .../82/bf9a1a10a4b25c1f14c9607b60970705e92545 | 1 + .../8b/82fb1794cb1c8c7f172ec730a4c2db0ae3e650 | 3 + .../9a/40a2f11c191f180c47e54b11567cb3c1e89b30 | Bin 0 -> 62 bytes .../9b/219343610c88a1187c996d0dc58330b55cee28 | 2 + .../9f/e06a50f4d1634d6c6879854d01d80857388706 | Bin 0 -> 65 bytes .../a4/1a49f8f5cd9b6cb14a076bf8394881ed0b4d19 | 3 + .../a9/53a018c5b10b20c86e69fef55ebc8ad4c5a417 | 1 + .../a9/cce3cd1b3efbda5b1f4a6dcc3f1570b2d3d74c | 1 + .../bd/1732c43c68d712ad09e1d872b9be6d4b9efdc4 | Bin 0 -> 158 bytes .../c3/7a783c20d92ac92362a78a32860f7eebf938ef | Bin 0 -> 158 bytes .../cb/dd40facab1682754eb67f7a43f29e672903cf6 | Bin 0 -> 51 bytes .../cd/f97fd3bb48eb3827638bb33d208f5fd32d0aa6 | Bin 0 -> 158 bytes .../d6/f10d549cb335b9e6d38afc1f0088be69b50494 | Bin 0 -> 62 bytes .../d9/acdc7ae7632adfeec67fa73c1e343cf4d1f47e | 1 + .../e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 | Bin 0 -> 15 bytes .../ef/0488f0b722f0be8bcb90a7730ac7efafd1d694 | 1 + .../fc/f7e3f51c11d199ab7a78403ee4f9ccd028da25 | Bin 0 -> 62 bytes .../twowaymerge.git/refs/heads/first-branch | 1 + .../twowaymerge.git/refs/heads/master | 1 + .../twowaymerge.git/refs/heads/second-branch | 1 + tests-clar/revwalk/mergebase.c | 118 +++++++++++++++++- 41 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 tests-clar/resources/twowaymerge.git/HEAD create mode 100644 tests-clar/resources/twowaymerge.git/config create mode 100644 tests-clar/resources/twowaymerge.git/description create mode 100644 tests-clar/resources/twowaymerge.git/info/exclude create mode 100644 tests-clar/resources/twowaymerge.git/objects/0c/8a3f1f3d5f421cf83048c7c73ee3b55a5e0f29 create mode 100644 tests-clar/resources/twowaymerge.git/objects/10/2dce8e3081f398e4bdd9fd894dc85ac3ca6a67 create mode 100644 tests-clar/resources/twowaymerge.git/objects/17/7d8634a28e26ec7819284752757ebe01a479d5 create mode 100644 tests-clar/resources/twowaymerge.git/objects/1c/30b88f5f3ee66d78df6520a7de9e89b890818b create mode 100644 tests-clar/resources/twowaymerge.git/objects/1f/4c0311a24b63f6fc209a59a1e404942d4a5006 create mode 100644 tests-clar/resources/twowaymerge.git/objects/22/24e191514cb4bd8c566d80dac22dfcb1e9bb83 create mode 100644 tests-clar/resources/twowaymerge.git/objects/29/6e56023cdc034d2735fee8c0d85a659d1b07f4 create mode 100644 tests-clar/resources/twowaymerge.git/objects/31/51880ae2b363f1c262cf98b750c1f169a0d432 create mode 100644 tests-clar/resources/twowaymerge.git/objects/3b/287f8730c81d0b763c2d294618a5e32b67b4f8 create mode 100644 tests-clar/resources/twowaymerge.git/objects/42/b7311aa626e712891940c1ec5d5cba201946a4 create mode 100644 tests-clar/resources/twowaymerge.git/objects/49/6d6428b9cf92981dc9495211e6e1120fb6f2ba create mode 100644 tests-clar/resources/twowaymerge.git/objects/59/b0cf7d74659e1cdb13305319d6d4ce2733c118 create mode 100644 tests-clar/resources/twowaymerge.git/objects/6a/b5d28acbf3c3bdff276f7ccfdf29c1520e542f create mode 100644 tests-clar/resources/twowaymerge.git/objects/6c/fca542b55b8b37017e6125a4b8f59a6eae6f11 create mode 100644 tests-clar/resources/twowaymerge.git/objects/76/5b32c65d38f04c4f287abda055818ec0f26912 create mode 100644 tests-clar/resources/twowaymerge.git/objects/7b/8c336c45fc6895c1c60827260fe5d798e5d247 create mode 100644 tests-clar/resources/twowaymerge.git/objects/82/bf9a1a10a4b25c1f14c9607b60970705e92545 create mode 100644 tests-clar/resources/twowaymerge.git/objects/8b/82fb1794cb1c8c7f172ec730a4c2db0ae3e650 create mode 100644 tests-clar/resources/twowaymerge.git/objects/9a/40a2f11c191f180c47e54b11567cb3c1e89b30 create mode 100644 tests-clar/resources/twowaymerge.git/objects/9b/219343610c88a1187c996d0dc58330b55cee28 create mode 100644 tests-clar/resources/twowaymerge.git/objects/9f/e06a50f4d1634d6c6879854d01d80857388706 create mode 100644 tests-clar/resources/twowaymerge.git/objects/a4/1a49f8f5cd9b6cb14a076bf8394881ed0b4d19 create mode 100644 tests-clar/resources/twowaymerge.git/objects/a9/53a018c5b10b20c86e69fef55ebc8ad4c5a417 create mode 100644 tests-clar/resources/twowaymerge.git/objects/a9/cce3cd1b3efbda5b1f4a6dcc3f1570b2d3d74c create mode 100644 tests-clar/resources/twowaymerge.git/objects/bd/1732c43c68d712ad09e1d872b9be6d4b9efdc4 create mode 100644 tests-clar/resources/twowaymerge.git/objects/c3/7a783c20d92ac92362a78a32860f7eebf938ef create mode 100644 tests-clar/resources/twowaymerge.git/objects/cb/dd40facab1682754eb67f7a43f29e672903cf6 create mode 100644 tests-clar/resources/twowaymerge.git/objects/cd/f97fd3bb48eb3827638bb33d208f5fd32d0aa6 create mode 100644 tests-clar/resources/twowaymerge.git/objects/d6/f10d549cb335b9e6d38afc1f0088be69b50494 create mode 100644 tests-clar/resources/twowaymerge.git/objects/d9/acdc7ae7632adfeec67fa73c1e343cf4d1f47e create mode 100644 tests-clar/resources/twowaymerge.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 create mode 100644 tests-clar/resources/twowaymerge.git/objects/ef/0488f0b722f0be8bcb90a7730ac7efafd1d694 create mode 100644 tests-clar/resources/twowaymerge.git/objects/fc/f7e3f51c11d199ab7a78403ee4f9ccd028da25 create mode 100644 tests-clar/resources/twowaymerge.git/refs/heads/first-branch create mode 100644 tests-clar/resources/twowaymerge.git/refs/heads/master create mode 100644 tests-clar/resources/twowaymerge.git/refs/heads/second-branch diff --git a/tests-clar/resources/twowaymerge.git/HEAD b/tests-clar/resources/twowaymerge.git/HEAD new file mode 100644 index 000000000..cb089cd89 --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/tests-clar/resources/twowaymerge.git/config b/tests-clar/resources/twowaymerge.git/config new file mode 100644 index 000000000..c53d818dd --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/config @@ -0,0 +1,5 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = true + ignorecase = true diff --git a/tests-clar/resources/twowaymerge.git/description b/tests-clar/resources/twowaymerge.git/description new file mode 100644 index 000000000..498b267a8 --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/tests-clar/resources/twowaymerge.git/info/exclude b/tests-clar/resources/twowaymerge.git/info/exclude new file mode 100644 index 000000000..a5196d1be --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/tests-clar/resources/twowaymerge.git/objects/0c/8a3f1f3d5f421cf83048c7c73ee3b55a5e0f29 b/tests-clar/resources/twowaymerge.git/objects/0c/8a3f1f3d5f421cf83048c7c73ee3b55a5e0f29 new file mode 100644 index 0000000000000000000000000000000000000000..12698affab4238d1a9cd8efe845514523d1a7e4e GIT binary patch literal 157 zcmV;O0Al}m0iBLZ3c@fH0A1%4?*f*WmzOjF5qE-HPmph`m_}-Pf9n<84#P09)%xf_ z#D~7-4CGAK21&&fQE{SC>5{XJn5_0jyCegSg~i*idFdbv@1B&NI2ct-iGL?isx=eEK0pw literal 0 HcmV?d00001 diff --git a/tests-clar/resources/twowaymerge.git/objects/10/2dce8e3081f398e4bdd9fd894dc85ac3ca6a67 b/tests-clar/resources/twowaymerge.git/objects/10/2dce8e3081f398e4bdd9fd894dc85ac3ca6a67 new file mode 100644 index 0000000000000000000000000000000000000000..3806ee74cf9a9e0f45db0d033bebed587e3dac37 GIT binary patch literal 54 zcmb9v}7¾TKy4`6‡¶æ š,y’9j§GJì8ÁÇÞb¢‘\Œfõ–5/ Ç^‰8v¹'ö‚Ù˜ì`SƝ%[›ë +÷T[ƒ[×úŠ,púüÌsºL6o±Kµœ´5Ø;ŽèÕn÷›-ÿ= ²úÿDà \ No newline at end of file diff --git a/tests-clar/resources/twowaymerge.git/objects/1f/4c0311a24b63f6fc209a59a1e404942d4a5006 b/tests-clar/resources/twowaymerge.git/objects/1f/4c0311a24b63f6fc209a59a1e404942d4a5006 new file mode 100644 index 000000000..99288fdd7 --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/objects/1f/4c0311a24b63f6fc209a59a1e404942d4a5006 @@ -0,0 +1,2 @@ +xÍ=Â0 @aæœÂ ²Mê6BlH¬œ ¿m!RqïO¹ë7¼[­‹ rÐ5g°N’Xƒ‹Å±)Eg]ÏDY2c R8xã7Û +ØTáÞÁ­½Rõo8~òœ®Ó¢óºØêèÔ[”™àˆ#¢Ùußjþ;`¼ùÔÙ7ó \ No newline at end of file diff --git a/tests-clar/resources/twowaymerge.git/objects/22/24e191514cb4bd8c566d80dac22dfcb1e9bb83 b/tests-clar/resources/twowaymerge.git/objects/22/24e191514cb4bd8c566d80dac22dfcb1e9bb83 new file mode 100644 index 000000000..48466ea51 --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/objects/22/24e191514cb4bd8c566d80dac22dfcb1e9bb83 @@ -0,0 +1,3 @@ +xŽK +Â0@]çsK&¤ ˆ¸Üz‚™4éÛHMïo½‚Û÷àñbY–©‚1tª[JàbŽlɈµâ¥í4vÉ¡±Lâ³ ì'—՛·´V`B¦û . +ëÎIöm ï1õZ¨Ç x¯cÙàK­ðhà^^ýÂ+\>?2·aªã.M,Ë°µtTB‹pÖ^kuÐc³¦¿jV_«sFh \ No newline at end of file diff --git a/tests-clar/resources/twowaymerge.git/objects/29/6e56023cdc034d2735fee8c0d85a659d1b07f4 b/tests-clar/resources/twowaymerge.git/objects/29/6e56023cdc034d2735fee8c0d85a659d1b07f4 new file mode 100644 index 0000000000000000000000000000000000000000..aa3fccdf0c0bc5425c76decb4105a908641c9e44 GIT binary patch literal 51 zcmb)BU|?ckU~CxZky2sy{o)&6@%5I~<=N}B`*#(-@bv%SvLZz&%#)#d Hr|fzF-?|ht literal 0 HcmV?d00001 diff --git a/tests-clar/resources/twowaymerge.git/objects/31/51880ae2b363f1c262cf98b750c1f169a0d432 b/tests-clar/resources/twowaymerge.git/objects/31/51880ae2b363f1c262cf98b750c1f169a0d432 new file mode 100644 index 0000000000000000000000000000000000000000..235d42bff5f9d890465806df814f5fb954a12429 GIT binary patch literal 68 zcmV-K0K5Nq0V^p=O;s>5FlI0`FfcPQQAlKXHuur&O&6~@dv|NDE04Ny=t)oTM5tsE aKFMT!k}3EkQ}Icr;gd|qDhU8=`C@}+o*X;? literal 0 HcmV?d00001 diff --git a/tests-clar/resources/twowaymerge.git/objects/3b/287f8730c81d0b763c2d294618a5e32b67b4f8 b/tests-clar/resources/twowaymerge.git/objects/3b/287f8730c81d0b763c2d294618a5e32b67b4f8 new file mode 100644 index 0000000000000000000000000000000000000000..56ddac5ee6ce544f60ff65dcfa1601822f76dcb3 GIT binary patch literal 54 zcmb)5VqjumU~CxZky2sy{o)&6@%5I~<=N}B`*#(-@bv%S!tmz_{}%v( Ch!a`> literal 0 HcmV?d00001 diff --git a/tests-clar/resources/twowaymerge.git/objects/59/b0cf7d74659e1cdb13305319d6d4ce2733c118 b/tests-clar/resources/twowaymerge.git/objects/59/b0cf7d74659e1cdb13305319d6d4ce2733c118 new file mode 100644 index 0000000000000000000000000000000000000000..30b507c06839e5ee67fc272a15916040a7e4dc5c GIT binary patch literal 65 zcmV-H0KWft0V^p=O;s>7H(@X|FfcPQQAlKXHuur&O&6~@dv|NDE04Ny=t)oTM5tsE XKFKtElIi#)Gw?}fVwD5{Dgsp456~ID literal 0 HcmV?d00001 diff --git a/tests-clar/resources/twowaymerge.git/objects/6a/b5d28acbf3c3bdff276f7ccfdf29c1520e542f b/tests-clar/resources/twowaymerge.git/objects/6a/b5d28acbf3c3bdff276f7ccfdf29c1520e542f new file mode 100644 index 000000000..ff6a386ac --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/objects/6a/b5d28acbf3c3bdff276f7ccfdf29c1520e542f @@ -0,0 +1 @@ +xÎM‚0@a×=Å\@2ýcܙ¸õeÚ†Rƒåþâܾŗǵ”¹RæÔ¶”@¢Šœ(i$™uOÉ 1ö9Ro"“ ¬9¸à¼x‡-­ ü@¬µcc3;ê-KvHÊ+‡9ÙèÁFe¼{›êO®­Á£ƒ{]b +\>¿òoãܦ}踖+Hm zšàŒ„(Žzl¶ô7 ñ•œF- \ No newline at end of file diff --git a/tests-clar/resources/twowaymerge.git/objects/6c/fca542b55b8b37017e6125a4b8f59a6eae6f11 b/tests-clar/resources/twowaymerge.git/objects/6c/fca542b55b8b37017e6125a4b8f59a6eae6f11 new file mode 100644 index 0000000000000000000000000000000000000000..9a969a279bce6d737174d2eea9425b47d9029236 GIT binary patch literal 68 zcmV-K0K5Nq0V^p=O;s>5FlI0`FfcPQQAlKXHuur&O&6~@dv|NDE04Ny=t)oTM5tsE aKFKtElIi#)Gw?}f;*-q6DhU8_sbZ3D)*Pz< literal 0 HcmV?d00001 diff --git a/tests-clar/resources/twowaymerge.git/objects/76/5b32c65d38f04c4f287abda055818ec0f26912 b/tests-clar/resources/twowaymerge.git/objects/76/5b32c65d38f04c4f287abda055818ec0f26912 new file mode 100644 index 0000000000000000000000000000000000000000..493bbc076b4fec7fb33ff4401945b46b667520d5 GIT binary patch literal 54 zcmbYGMÌV½eMK9¢ÑZˆƒ5ÙæHè¥õ¢#{¦ž¥E´J¶:–î±Ô +·®åÕϲÀéó“Çp¦:n¡‰e>ƒ6-£sH GìÕ®ûfMÔS}ZE² \ No newline at end of file diff --git a/tests-clar/resources/twowaymerge.git/objects/82/bf9a1a10a4b25c1f14c9607b60970705e92545 b/tests-clar/resources/twowaymerge.git/objects/82/bf9a1a10a4b25c1f14c9607b60970705e92545 new file mode 100644 index 000000000..89b0b9f9b --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/objects/82/bf9a1a10a4b25c1f14c9607b60970705e92545 @@ -0,0 +1 @@ +xŽË Â09»Šm€hã_ÖBܐ¸R×Ÿ„cœþ1-p§yšPKy4RږD›GŒF»ÀJvÉFE>‡1#q²Ž j§ÅÛoimbvSŽŠYSbEr²Š¸»Q"eÓÑ{+üޖºÁ=ÔÖà6Àµ¾bñ+œ>?òœ/ó£-;¡–3ŒÊhœ¬C‚#¢è´g¶ô÷XÄÌyF¤ \ No newline at end of file diff --git a/tests-clar/resources/twowaymerge.git/objects/8b/82fb1794cb1c8c7f172ec730a4c2db0ae3e650 b/tests-clar/resources/twowaymerge.git/objects/8b/82fb1794cb1c8c7f172ec730a4c2db0ae3e650 new file mode 100644 index 000000000..8e9b758ea --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/objects/8b/82fb1794cb1c8c7f172ec730a4c2db0ae3e650 @@ -0,0 +1,3 @@ +xÎ½ Â0@ajOq ù7BtH´Lp¾ó%A8FÁٟ°íW<=ª¥Ì ¬õ‡¶æ x"ʎØ$—%1†dÄcÏDNLˆ:Yv=©7®yiÐc +l¤$Ž\b{‰DÂbOd‚Õ9x+ +·6ÕT[ƒ{·ú₠œ??yŽ×qnӖ:ªåƯcÔÞÁQZ«]÷͖ÿ¨¢¾7 H† \ No newline at end of file diff --git a/tests-clar/resources/twowaymerge.git/objects/9a/40a2f11c191f180c47e54b11567cb3c1e89b30 b/tests-clar/resources/twowaymerge.git/objects/9a/40a2f11c191f180c47e54b11567cb3c1e89b30 new file mode 100644 index 0000000000000000000000000000000000000000..1de1224f7533b0ab4dff1b7cf4f9eaa07f92a8b2 GIT binary patch literal 62 zcmV-E0Kxxw0V^p=O;s>7F=a3`FfcPQQAlKXHuur&O&6~@dv|NDE04Ny=t)oTM5tso UKFJ(>lDYUK^RP++0CD0+F~%VoEdT%j literal 0 HcmV?d00001 diff --git a/tests-clar/resources/twowaymerge.git/objects/9b/219343610c88a1187c996d0dc58330b55cee28 b/tests-clar/resources/twowaymerge.git/objects/9b/219343610c88a1187c996d0dc58330b55cee28 new file mode 100644 index 000000000..8b64b4381 --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/objects/9b/219343610c88a1187c996d0dc58330b55cee28 @@ -0,0 +1,2 @@ +xÏKj1Ьç½óÊFj}Z‚¼3²Ê ¤VÏÇdFA#ß?’\ ËzÅu]—FÓSo" ‰JðÆ& ‚^˜‚Ž,9$G’Eéd)7|¦&[6”(FU"&Žh< ¯FÉc4AÆ¿>"ZÑQ;m9Û\;ïKP%1b9k‰93¤GŸkƒw®½Ãënõ£¬iƒçý[îÓuZúüÈ®ë hã¬"RÞÂY¥†C[]þ=0¼I›rKÏp—¶÷óO:Á²õ +»pÝʯ _¾(c‡ \ No newline at end of file diff --git a/tests-clar/resources/twowaymerge.git/objects/9f/e06a50f4d1634d6c6879854d01d80857388706 b/tests-clar/resources/twowaymerge.git/objects/9f/e06a50f4d1634d6c6879854d01d80857388706 new file mode 100644 index 0000000000000000000000000000000000000000..055de01580a58db62f907e09c049224b8be26e26 GIT binary patch literal 65 zcmV-H0KWft0V^p=O;s>7H(@X|FfcPQQAlKXHuur&O&6~@dv|NDE04Ny=t)oTM5tsE XKFMT!k}3Ek)9^{AW0eE|CplEk5=R<2 literal 0 HcmV?d00001 diff --git a/tests-clar/resources/twowaymerge.git/objects/a4/1a49f8f5cd9b6cb14a076bf8394881ed0b4d19 b/tests-clar/resources/twowaymerge.git/objects/a4/1a49f8f5cd9b6cb14a076bf8394881ed0b4d19 new file mode 100644 index 000000000..cb4d34e77 --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/objects/a4/1a49f8f5cd9b6cb14a076bf8394881ed0b4d19 @@ -0,0 +1,3 @@ +xÎ½ Â0@ajOq Ýù7'!D‡DËöÙ A$FÁٟ°íW<=©ó<5ÐÚÚZ +8N(CÈÁzDž$'2!Î>[):#D½zǵ, zŽ £MÚ d…=†ä‘t…µ³NÅ­=ê +w©­Á­ƒk}å9.púüä9^Æ©=¶ÔIÏ@ÆY ž‰áˆ=¢ÚußlåÔ°Dâ \ No newline at end of file diff --git a/tests-clar/resources/twowaymerge.git/objects/a9/53a018c5b10b20c86e69fef55ebc8ad4c5a417 b/tests-clar/resources/twowaymerge.git/objects/a9/53a018c5b10b20c86e69fef55ebc8ad4c5a417 new file mode 100644 index 000000000..8235f1839 --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/objects/a9/53a018c5b10b20c86e69fef55ebc8ad4c5a417 @@ -0,0 +1 @@ +xÍJÄ0…]÷)înV3$¹is"îÁ•Oû“NŶ’ɼ¿ñ\žï|8²¯ëÒ!dzèÍ ªÔdXG/ޫϹp*‰¢C³X³ˆº@ZÂ8|•f[VŸ0HD™H“E]6¯”g¶I#g«*ñÏ­9UEæHÆH!MḦÕñh‚ºR¦¡Üûuoð.{ïðz—ýSײÁãí‡|ÌÏóÒ¯w¾È¾>Ç1º4‘C8;rn8èq«Û¿†7k³·²ÉNui·~þM§áÜ^­ \ No newline at end of file diff --git a/tests-clar/resources/twowaymerge.git/objects/a9/cce3cd1b3efbda5b1f4a6dcc3f1570b2d3d74c b/tests-clar/resources/twowaymerge.git/objects/a9/cce3cd1b3efbda5b1f4a6dcc3f1570b2d3d74c new file mode 100644 index 000000000..4da7e826a --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/objects/a9/cce3cd1b3efbda5b1f4a6dcc3f1570b2d3d74c @@ -0,0 +1 @@ +x+)JMU044c040031QHdx6÷ÑìM¯9{wk®+ºqèIOðD¨d6>É|’¹X%>½9j \ No newline at end of file diff --git a/tests-clar/resources/twowaymerge.git/objects/bd/1732c43c68d712ad09e1d872b9be6d4b9efdc4 b/tests-clar/resources/twowaymerge.git/objects/bd/1732c43c68d712ad09e1d872b9be6d4b9efdc4 new file mode 100644 index 0000000000000000000000000000000000000000..b9b60122d7044e8382ae6c6339d126dfc7524424 GIT binary patch literal 158 zcmV;P0Ac@l0iBLP4uUWc06q5=`vJ+e+ofw_j5ianzMw2EV1ybh{};dDb&{EkmU*5k zIOh*_O$kEF9XV~eC&}p5XD1nkRU&1ZspssS)hvWwG-#ld zsAG!i!Lrbl2Z{Sv5{TvrKe}3dST!*QSTi0lrFJOs1wgE}th=OQ#x^LF> McfhFm0ySSn$XT09J^%m! literal 0 HcmV?d00001 diff --git a/tests-clar/resources/twowaymerge.git/objects/c3/7a783c20d92ac92362a78a32860f7eebf938ef b/tests-clar/resources/twowaymerge.git/objects/c3/7a783c20d92ac92362a78a32860f7eebf938ef new file mode 100644 index 0000000000000000000000000000000000000000..041e890abacd84fbfa028b11891f671377b52fe2 GIT binary patch literal 158 zcmV;P0Ac@l0iDiG4uUWcKw;NC#auu#(;ucJ#<(+a>j~On0F6+C<^JLo+9<bR_^!dqiyo`@JZMl&$pMhNP$c%yEh!N53x^Gtf MJ75;`1v)83>3AheTmS$7 literal 0 HcmV?d00001 diff --git a/tests-clar/resources/twowaymerge.git/objects/cb/dd40facab1682754eb67f7a43f29e672903cf6 b/tests-clar/resources/twowaymerge.git/objects/cb/dd40facab1682754eb67f7a43f29e672903cf6 new file mode 100644 index 0000000000000000000000000000000000000000..ccb156d889008fbd24fd13354e0e50183c0cdeec GIT binary patch literal 51 zcmb)BU|?ckU~CxZky2sy{o)&6@%5I~<=N}B`*#(-@bv%SvLeMS%#)#} HUUmln;5ig0 literal 0 HcmV?d00001 diff --git a/tests-clar/resources/twowaymerge.git/objects/cd/f97fd3bb48eb3827638bb33d208f5fd32d0aa6 b/tests-clar/resources/twowaymerge.git/objects/cd/f97fd3bb48eb3827638bb33d208f5fd32d0aa6 new file mode 100644 index 0000000000000000000000000000000000000000..0e028dc019f5399a42380532e9d084f02c6dc0fe GIT binary patch literal 158 zcmV;P0Ac@l0iBLP4#FT106p`H{eTSxWNBiIHxsYEU|E*7MvAHQ|JE;fnZq0=!?l#T zfidpTRuM=8abhGvZw;j^!X7iBj8V(Q0Cp zOgZ(*4^Gk6rnhkP$+Wor9Ck-NgXE2^a(b literal 0 HcmV?d00001 diff --git a/tests-clar/resources/twowaymerge.git/objects/d9/acdc7ae7632adfeec67fa73c1e343cf4d1f47e b/tests-clar/resources/twowaymerge.git/objects/d9/acdc7ae7632adfeec67fa73c1e343cf4d1f47e new file mode 100644 index 000000000..de94528a4 --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/objects/d9/acdc7ae7632adfeec67fa73c1e343cf4d1f47e @@ -0,0 +1 @@ +x+)JMU044c040031QHdx6÷ÑìM¯9{wk®+ºqèIOðD¨d>É4|’éX%:79U \ No newline at end of file diff --git a/tests-clar/resources/twowaymerge.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/tests-clar/resources/twowaymerge.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 new file mode 100644 index 0000000000000000000000000000000000000000..711223894375fe1186ac5bfffdc48fb1fa1e65cc GIT binary patch literal 15 WcmbhkP$+WorV%4mCGBwm>4qc+yw!^%@`H{ literal 0 HcmV?d00001 diff --git a/tests-clar/resources/twowaymerge.git/refs/heads/first-branch b/tests-clar/resources/twowaymerge.git/refs/heads/first-branch new file mode 100644 index 000000000..ef0dead7f --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/refs/heads/first-branch @@ -0,0 +1 @@ +2224e191514cb4bd8c566d80dac22dfcb1e9bb83 diff --git a/tests-clar/resources/twowaymerge.git/refs/heads/master b/tests-clar/resources/twowaymerge.git/refs/heads/master new file mode 100644 index 000000000..ebf18f58e --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/refs/heads/master @@ -0,0 +1 @@ +1c30b88f5f3ee66d78df6520a7de9e89b890818b diff --git a/tests-clar/resources/twowaymerge.git/refs/heads/second-branch b/tests-clar/resources/twowaymerge.git/refs/heads/second-branch new file mode 100644 index 000000000..586a14a84 --- /dev/null +++ b/tests-clar/resources/twowaymerge.git/refs/heads/second-branch @@ -0,0 +1 @@ +9b219343610c88a1187c996d0dc58330b55cee28 diff --git a/tests-clar/revwalk/mergebase.c b/tests-clar/revwalk/mergebase.c index c70222f19..a44e35b54 100644 --- a/tests-clar/revwalk/mergebase.c +++ b/tests-clar/revwalk/mergebase.c @@ -3,10 +3,12 @@ #include static git_repository *_repo; +static git_repository *_repo2; void test_revwalk_mergebase__initialize(void) { cl_git_pass(git_repository_open(&_repo, cl_fixture("testrepo.git"))); + cl_git_pass(git_repository_open(&_repo2, cl_fixture("twowaymerge.git"))); } void test_revwalk_mergebase__cleanup(void) @@ -81,6 +83,19 @@ void test_revwalk_mergebase__merged_branch(void) cl_assert(behind == 0); } +void test_revwalk_meregebase__two_way_merge(void) +{ + git_oid one, two; + int ahead, behind; + + cl_git_pass(git_oid_fromstr(&one, "9b219343610c88a1187c996d0dc58330b55cee28")); + cl_git_pass(git_oid_fromstr(&two, "a953a018c5b10b20c86e69fef55ebc8ad4c5a417")); + cl_git_pass(git_count_ahead_behind(&ahead, &behind, _repo2, &one, &two)); + + cl_assert(ahead == 8); + cl_assert(behind == 2); +} + void test_revwalk_mergebase__no_common_ancestor_returns_ENOTFOUND(void) { git_oid result, one, two; @@ -176,7 +191,7 @@ void test_revwalk_mergebase__many_merge_branch(void) } /* - * $ git log --graph --all + * testrepo.git $ git log --graph --all * * commit 763d71aadf09a7951596c9746c024e7eece7c7af * | Author: nulltoken * | Date: Sun Oct 9 12:54:47 2011 +0200 @@ -255,3 +270,104 @@ void test_revwalk_mergebase__many_merge_branch(void) * * packed commit one */ + +/* + * twowaymerge.git $ git log --graph --all + * * commit 9b219343610c88a1187c996d0dc58330b55cee28 + * |\ Merge: c37a783 2224e19 + * | | Author: Scott J. Goldman + * | | Date: Tue Nov 27 20:31:04 2012 -0800 + * | | + * | | Merge branch 'first-branch' into second-branch + * | | + * | * commit 2224e191514cb4bd8c566d80dac22dfcb1e9bb83 + * | | Author: Scott J. Goldman + * | | Date: Tue Nov 27 20:28:51 2012 -0800 + * | | + * | | j + * | | + * | * commit a41a49f8f5cd9b6cb14a076bf8394881ed0b4d19 + * | | Author: Scott J. Goldman + * | | Date: Tue Nov 27 20:28:39 2012 -0800 + * | | + * | | i + * | | + * | * commit 82bf9a1a10a4b25c1f14c9607b60970705e92545 + * | | Author: Scott J. Goldman + * | | Date: Tue Nov 27 20:28:28 2012 -0800 + * | | + * | | h + * | | + * * | commit c37a783c20d92ac92362a78a32860f7eebf938ef + * | | Author: Scott J. Goldman + * | | Date: Tue Nov 27 20:30:57 2012 -0800 + * | | + * | | n + * | | + * * | commit 8b82fb1794cb1c8c7f172ec730a4c2db0ae3e650 + * | | Author: Scott J. Goldman + * | | Date: Tue Nov 27 20:30:43 2012 -0800 + * | | + * | | m + * | | + * * | commit 6ab5d28acbf3c3bdff276f7ccfdf29c1520e542f + * | | Author: Scott J. Goldman + * | | Date: Tue Nov 27 20:30:38 2012 -0800 + * | | + * | | l + * | | + * * | commit 7b8c336c45fc6895c1c60827260fe5d798e5d247 + * | | Author: Scott J. Goldman + * | | Date: Tue Nov 27 20:30:24 2012 -0800 + * | | + * | | k + * | | + * | | * commit 1c30b88f5f3ee66d78df6520a7de9e89b890818b + * | | | Author: Scott J. Goldman + * | | | Date: Tue Nov 27 20:28:10 2012 -0800 + * | | | + * | | | e + * | | | + * | | * commit 42b7311aa626e712891940c1ec5d5cba201946a4 + * | | | Author: Scott J. Goldman + * | | | Date: Tue Nov 27 20:28:06 2012 -0800 + * | | | + * | | | d + * | | | + * | | * commit a953a018c5b10b20c86e69fef55ebc8ad4c5a417 + * | | |\ Merge: bd1732c cdf97fd + * | | |/ Author: Scott J. Goldman + * | |/| Date: Tue Nov 27 20:26:43 2012 -0800 + * | | | + * | | | Merge branch 'first-branch' + * | | | + * | * | commit cdf97fd3bb48eb3827638bb33d208f5fd32d0aa6 + * | | | Author: Scott J. Goldman + * | | | Date: Tue Nov 27 20:24:46 2012 -0800 + * | | | + * | | | g + * | | | + * | * | commit ef0488f0b722f0be8bcb90a7730ac7efafd1d694 + * | | | Author: Scott J. Goldman + * | | | Date: Tue Nov 27 20:24:39 2012 -0800 + * | | | + * | | | f + * | | | + * | | * commit bd1732c43c68d712ad09e1d872b9be6d4b9efdc4 + * | |/ Author: Scott J. Goldman + * | | Date: Tue Nov 27 17:43:58 2012 -0800 + * | | + * | | c + * | | + * | * commit 0c8a3f1f3d5f421cf83048c7c73ee3b55a5e0f29 + * |/ Author: Scott J. Goldman + * | Date: Tue Nov 27 17:43:48 2012 -0800 + * | + * | b + * | + * * commit 1f4c0311a24b63f6fc209a59a1e404942d4a5006 + * Author: Scott J. Goldman + * Date: Tue Nov 27 17:43:41 2012 -0800 + * + * a + */ -- 2.39.5