*/
GIT_MERGE_FIND_RENAMES = (1 << 0),
+ /**
+ * If a conflict occurs, exit immediately instead of attempting to
+ * continue resolving conflicts. The merge operation will fail with
+ * GIT_EMERGECONFLICT and no index will be returned.
+ */
+ GIT_MERGE_FAIL_ON_CONFLICT = (1 << 1),
+
/**
* Do not write the REUC extension on the generated index
*/
GIT_MERGE_SKIP_REUC = (1 << 2),
/**
- * If a conflict occurs, exit immediately instead of attempting to
- * continue resolving conflicts. The merge operation will fail with
- * GIT_EMERGECONFLICT and no index will be returned.
+ * If the commits being merged have multiple merge bases, do not build
+ * a recursive merge base (by merging the multiple merge bases),
+ * instead simply use the first base. This flag provides a similar
+ * merge base to `git-merge-resolve`.
*/
- GIT_MERGE_FAIL_ON_CONFLICT = (1 << 1),
+ GIT_MERGE_NO_RECURSIVE = (1 << 3),
} git_merge_flag_t;
/**
#include "tree.h"
#include "merge_helpers.h"
#include "merge.h"
+#include "index.h"
#include "git2/merge.h"
#include "git2/sys/index.h"
#include "git2/annotated_commit.h"
const git_index_entry *index_entry;
/*
- dump_index_entries(&index->entries);
+ merge__dump_index_entries(&index->entries);
*/
if (git_index_entrycount(index) != expected_len)
--- /dev/null
+#include "clar_libgit2.h"
+#include "git2/repository.h"
+#include "git2/merge.h"
+#include "merge.h"
+#include "../merge_helpers.h"
+
+static git_repository *repo;
+
+#define TEST_REPO_PATH "merge-recursive"
+
+void test_merge_trees_recursive__initialize(void)
+{
+ repo = cl_git_sandbox_init(TEST_REPO_PATH);
+}
+
+void test_merge_trees_recursive__cleanup(void)
+{
+ cl_git_sandbox_cleanup();
+}
+
+void test_merge_trees_recursive__one(void)
+{
+ git_index *index;
+ git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+ struct merge_index_entry merge_index_entries[] = {
+ { 0100644, "dea7215f259b2cced87d1bda6c72f8b4ce37a2ff", 0, "asparagus.txt" },
+ { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+ { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+ { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+ { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+ { 0100644, "94d2c01087f48213bd157222d54edfefd77c9bba", 0, "veal.txt" },
+ };
+
+ cl_git_pass(merge_commits_from_branches(&index, repo, "branchA-1", "branchA-2", &opts));
+
+ cl_assert(merge_test_index(index, merge_index_entries, 6));
+
+ git_index_free(index);
+}
+
+void test_merge_trees_recursive__one_norecursive(void)
+{
+ git_index *index;
+ git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+ struct merge_index_entry merge_index_entries[] = {
+ { 0100644, "dea7215f259b2cced87d1bda6c72f8b4ce37a2ff", 0, "asparagus.txt" },
+ { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+ { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+ { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+ { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+ { 0100644, "94d2c01087f48213bd157222d54edfefd77c9bba", 0, "veal.txt" },
+ };
+
+ opts.flags |= GIT_MERGE_NO_RECURSIVE;
+
+ cl_git_pass(merge_commits_from_branches(&index, repo, "branchA-1", "branchA-2", &opts));
+
+ cl_assert(merge_test_index(index, merge_index_entries, 6));
+
+ git_index_free(index);
+}
+
+void test_merge_trees_recursive__two(void)
+{
+ git_index *index;
+ git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+ struct merge_index_entry merge_index_entries[] = {
+ { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+ { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+ { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+ { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+ { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+ { 0100644, "666ffdfcf1eaa5641fa31064bf2607327e843c09", 0, "veal.txt" },
+ };
+
+ cl_git_pass(merge_commits_from_branches(&index, repo, "branchB-1", "branchB-2", &opts));
+
+ cl_assert(merge_test_index(index, merge_index_entries, 6));
+
+ git_index_free(index);
+}
+
+void test_merge_trees_recursive__two_norecursive(void)
+{
+ git_index *index;
+ git_merge_options opts = GIT_MERGE_OPTIONS_INIT;
+
+ opts.flags |= GIT_MERGE_NO_RECURSIVE;
+
+ struct merge_index_entry merge_index_entries[] = {
+ { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" },
+ { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" },
+ { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" },
+ { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" },
+ { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" },
+ { 0100644, "cb49ad76147f5f9439cbd6133708b76142660660", 1, "veal.txt" },
+ { 0100644, "b2a81ead9e722af0099fccfb478cea88eea749a2", 2, "veal.txt" },
+ { 0100644, "4e21d2d63357bde5027d1625f5ec6b430cdeb143", 3, "veal.txt" },
+ };
+
+ cl_git_pass(merge_commits_from_branches(&index, repo, "branchB-1", "branchB-2", &opts));
+
+ cl_assert(merge_test_index(index, merge_index_entries, 8));
+
+ git_index_free(index);
+}
+
--- /dev/null
+ref: refs/heads/branchB-1
--- /dev/null
+[core]
+ repositoryformatversion = 0
+ filemode = true
+ bare = false
+ logallrefupdates = true
+ ignorecase = true
+ precomposeunicode = true
--- /dev/null
+7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f refs/heads/master
--- /dev/null
+x\ 1¥OÛ\r\ 2!\10ô\9b*h@³àÂBb\8c?×\81\rðXr&Þa\10µ}ÑØ\81\7fóÈLfR]\96K\97\1aqÓ\e³\ 4°Q{\97\f\81\8e\80 `O\90\ 1\15zãÉ\9aètɤµ¸\85Æk\97\94(\16gØ\93+*+\97ÀX[F8ë\14\89¬\8d>¹\8cE\84G\9fk\93S~\85\96åy®Ë½®òÀCý \13\7f\8d\1fÛ¥º\1c¥B4Æ\80³Nn\ 1\ 1ÄPÇØÎ\7fÖ\88)\8fËO\ eWñ\ 6\15¯N:
\ No newline at end of file
--- /dev/null
+x\ 1¥\8fQ
+Â0\10DýÎ)r\ 1e\137É\16Düé\r¼@\93Ý¥\82m¤F½¾U¼\81\7f3o`\98)u\9a.ÍzÄM[D¬\8a\82Ó½\ 3,\ 4\98\18\82PH^\82w\ 5\ 3*)c&Îæ6,27\9bJÊJAºDêØQ\81\10£&ðìKN)ÆÜ\15bT3<ÚX\17ÛókXØ\9eÇ:Ýël\ f²Ò\8f:É7ø¹]©ÓÑ:Ä\10\90¢\8bv\v\b`Vº\8emòg\8déy½ü\94ájÞ=ïO\93
\ No newline at end of file
--- /dev/null
+x\ 1+)JMU022g040031QH,.H,JL/-Ö+©(aø¿9/Ð>þ~Wö\8a\80E\8cNéYZG\1aj¡
+\93RSÓÀj2¾Ièû´^\9e'Ìy³¦Î51ìÎ\1c\86i05ù¥\9999\99`eÞ5a\ 1\fÝz%õ\ f\eæ½\8e\92½Ç×ÐÊ\ 5U\96^\94XV VtäÙ\99Åo²\1e\88ô]2üY\14~¿ÇP\8e1\1eª(¿²¸$µ\bbãzùã\ eõ7×Þ\17g\Q·ñdLÉ\94£3 ªÊR\13sÀjü\14/]3\ eßû\94©VLõë\9blg\9e{\e\9d\ 1ÄW[ÿ
\ No newline at end of file
--- /dev/null
+x\ 1¥\8eÑ\r\ 2!\10Dý¦
+\1aа,\1c\90\18ã\8f\1dØÀ\1e»\973\91à jû\9eÆ\ eü\9by\93L^®¥\º¶\986½\89h±9ºqDLÉ\92ó~\ 4
+ä\r¤É\bF\8e\11\19'\17¼ºQ\93¥k$\9c<\r\92!§!2°eÏÖ°\88a\18\80\1cz\98lH\8a\1e}®M\9føE\8dõy®å^\17½\97\95~ÒQ¾Ã¯ír-\a\rn\15ð`\82Õ[ã\8cQ+]e»üy£\9eBWõ\ 6y\8fM\85
\ No newline at end of file
--- /dev/null
+x\ 1¥\8f[
+\ 21\fEýî*²\ 1¥í¤\ fAÄ\9fÙ\81\eÈ´)#8S©U·o\14wàÇ\85ääÁ½©.Ë¥\83EÜôÆ\f8ØB\89tò6'ç<å`ÈÚb\avh\b=ÅI\17_Ô\8d\1a¯\1d\86\92ÑD\8d\14öÚç)ÊBq\1c}DÄ\10\1c \10)zô¹6\18ó\8bZ\86ó\\97{]áÀB?Õ\89¿\83_·Ku9\82AtÎ\19ë\ 3l5j\84\8aÙÎ\7f¾Qc\96ÈO¦«z\ 3\15nO6
\ No newline at end of file
--- /dev/null
+x\ 1¥\8d±NÄ0\10D©ý\15««ádç\1c'\91\10\82\ 2 ú\13ýÆÞ\V\8a½\91í\~\9f\80ø\ 3º\99÷¤\19/1r\85¦w\ f5\13\81m|À0è\vÒt¡ntƺ®%×ö\16û\91¬é\ 6k\ 6c\14nu\96\fïaÇ\1cà:K,\92à\99\ eú\93^éWüµ³\97ø\ 2ÆêÖ5¦í5<i«µ:èq^é\9f3ê3qe\ Ó\9d\vKRê\r&ڡȶ\1eÐóJ\ 5¦,\11N×\99à\8bó\8d\13#|ÈVhç\89N\8f\80wä\ 5Ç\85\80\13Ô\99Ôº\8d\v{\b\12\91ÓY}\ 3RYa)
\ No newline at end of file
--- /dev/null
+x\ 1¥OË \ 21\10õ\9c*Ò\80\92\7ffAÄËv`\ 3\99Ì\84\15\#1jûF±\ 3oï\ 3ï\93ëº\9e»4Îmzc\96l&\8b\85\88\10t\ 2o\11Q\a\ 4ôÀ\ 1\82 Å*p:9qK\8d¯]Æ\1c±\80ç)BѤ!+\1fB\89Ê\90É\18c\b8e WDzô¥69Ó+5\92§¥®÷z\95{\1eê\a\1dùküØ.×õ µsÞûÑgåV9¥ÄPÇØÎ\7fÆ\88\99Æå'§\8bx\ 3x\11O»
\ No newline at end of file
--- /dev/null
+x\ 1¥\8f½N\ 41\f\84©÷)Ü]uÈ^Ç!\91Nè\84DIÇ\v8\89Ã^±\e\94[Äë\13þz$ºñø\9b\91&·u½ìÀÂ7{7\ 3\94ì\15\9dfBÒD\1a\ 3{\8dRÄr(ä\93¯\9eÑÕ2½j·m\ 4\95«¨·L9úA\94¹H\99±\98áÀI\1d\vÕù.þò¡²TÆT\r£\10×ès\rª®T\fìÔØYä¤6éÛ¾´\ e\8få]{\81ç¥×¶ÁÉ\86û©Îöõø¹ns[ï\81\9c\13\11¢(pD\878\rw\8cÛí\9f5Ó\93õ\17\83ï68üuÂ\ 1.ÛÞ uÝòòp¤é\ 3`\12p3
\ No newline at end of file
--- /dev/null
+x\ 1¥\8fA\ e \14D]s
+. ¡ðáCb\8c\9bÞÀ\vðác]´\98\96Æë\8bÆ\e¸\9b\99\97LfR\9dçG\93\1a¡ÌÒP\18\ 29öÑ¢%@\fÉk0L\1c\r\eb\ 2Ó¡/â\19W^\9aÄ\84T¼å\80¾\fyðIYç
+*\9du"Dç¨\17d("îmª«\1có+®YÞ¦:ou\91gîéG]ù\v~î\94ê|\91\ 3\80µà\9d²ò¨@)ÑÓ>¶ñ\9f5bÌýrÜú\85xß7ñ\ 6\13\18Qù
\ No newline at end of file
--- /dev/null
+x\ 1%P1nÄ0\fëìWð\ 1¹C\81NE§N7¶è¡\ 5:*\89\92\18p¬Ô\92/¸ßWÎm\ 2I\91\94ú$=^^\9f\9f._ï?¿¸~|\7f\9eC¸°\81ã¼\186©yTÈ\84A¨(#1eôÌÓé´\93.\88\86áÀ(\8fHto@̸K-a\13ë°Õ\ 3°\85¡´²\93sá1r6\ 5)&)8¸Å·TêÖa\8f¶<0×\87¿JÙ¢Ý[\87\9d\8cK\87\165IJ²\1f²ÈÀª\18cáÁ¸qÍ\93ì\8c«\15r_\ f\bÍÛ\87"u^@ÐÈ7~X)\97\9b÷2¸ Ýâ G\85,æ¥f¬R¸ùå`BÚ\ 2úÂ4¶3£½Áv\81Q\9fø¤\9bHÖ©¦Öuêa²b SwÞcJ q\ 4\85)fÆ\94èæO\82ùvû\8d×;\87\7fí«\8c\9f
\ No newline at end of file
--- /dev/null
+x\ 1ER»N\ 31\10¤öW,}D\87@J\95\8a\92\88\90\ fØóíå¬slÇ^'Êß3ö\ 5¨ü\9a\9dÇ®\a\1f\az}\7f{Ú\1dö»¯ÝÇñ@\87ÏãþÙ\98o^\84¦X3yÎ'¡¡\ 6;K¡8\11\97Ä\99Oµl¨ØÌIÈ)\ 5gÅß7d«\ 23Q\f¸F\89A\81ÎB\1a\13ð\1cFðÝÛÍ\19Ïtc\95\8c¢9¦\8e*Ê~)\1d\96@Ôa1´ÕL.\vÝ\9cÎÄ\94\9cXiV\ 6¶1\80öa2\ 6\at³PÓ*\96$%É\9d°°×áq$½EºTÎÚã<<\fÑùUP\9dï;úu\ 3áKu*Tâ¤\9b\ 6
+&Uß-\9fq̱\9e\9aâä*«nÑÌÈ\aè\9a\11ùÑ¥\rÝfgg:×¢4\b!£A\84¥µ¢ASÔm»Ä¹ãÁiQ°È\7f¨Þ\81\86m\rE\vÌß4\1eÜ3\8f F\85g\87\1dFÒ\93aD5 YÓ)\82G8@\a\9cõ\18*g1¥N\93³N\82ú;\8d\18_\vºjwÍÉã3\80¬*FÖ\ezv~y¤\95|í¿ ¦\17ó\ 3sÿÏö
\ No newline at end of file
--- /dev/null
+539bd011c4822c560c1d17cab095006b7a10f707
--- /dev/null
+0bb7ed583d7e9ad507e8b902594f5c9126ea456b
--- /dev/null
+a34e5a16feabbd0335a633aadb8217c9f3dba58d
--- /dev/null
+723181f1bfd30e47a6d1d36a4d874e31e7a0a1a4
--- /dev/null
+ASPARAGUS SOUP!
+
+Take four large bunches of asparagus, scrape it nicely, cut off one inch
+of the tops, and lay them in water, chop the stalks and put them on the
+fire with a piece of bacon, a large onion cut up, and pepper and salt;
+add two quarts of water, boil them till the stalks are quite soft, then
+pulp them through a sieve, and strain the water to it, which must be put
+back in the pot; put into it a chicken cut up, with the tops of
+asparagus which had been laid by, boil it until these last articles are
+sufficiently done, thicken with flour, butter and milk, and serve it up.
--- /dev/null
+BEEF SOUP.
+
+Take the hind shin of beef, cut off all the flesh off the leg-bone,
+which must be taken away entirely, or the soup will be greasy. Wash the
+meat clean and lay it in a pot, sprinkle over it one small
+table-spoonful of pounded black pepper, and two of salt; three onions
+the size of a hen's egg, cut small, six small carrots scraped and cut
+up, two small turnips pared and cut into dice; pour on three quarts of
+water, cover the pot close, and keep it gently and steadily boiling five
+hours, which will leave about three pints of clear soup; do not let the
+pot boil over, but take off the scum carefully, as it rises. When it has
+boiled four hours, put in a small bundle of thyme and parsley, and a
+pint of celery cut small, or a tea-spoonful of celery seed pounded.
+These latter ingredients would lose their delicate flavour if boiled too
+much. Just before you take it up, brown it in the following manner: put
+a small table-spoonful of nice brown sugar into an iron skillet, set it
+on the fire and stir it till it melts and looks very dark, pour into it
+a ladle full of the soup, a little at a time; stirring it all the while.
+Strain this browning and mix it well with the soup; take out the bundle
+of thyme and parsley, put the nicest pieces of meat in your tureen, and
+pour on the soup and vegetables; put in some toasted bread cut in dice,
+and serve it up.
--- /dev/null
+SOUP WITH BOUILLI.
+
+Take the nicest part of the thick brisket of beef, about eight pounds,
+put it into a pot with every thing directed for the other soup; make it
+exactly in the same way, only put it on an hour sooner, that you may
+have time to prepare the bouilli; after it has boiled five hours, take
+out the beef, cover up the soup and set it near the fire that it may
+keep hot. Take the skin off the beef, have the yelk of an egg well
+beaten, dip a feather in it and wash the top of your beef, sprinkle over
+it the crumb of stale bread finely grated, put it in a Dutch oven
+previously heated, put the top on with coals enough to brown, but not
+burn the beef; let it stand nearly an hour, and prepare your gravy
+thus:--Take a sufficient quantity of soup and the vegetables boiled in
+it; add to it a table-spoonful of red wine, and two of mushroom catsup,
+thicken with a little bit of butter and a little brown flour; make it
+very hot, pour it in your dish, and put the beef on it. Garnish it with
+green pickle, cut in thin slices, serve up the soup in a tureen with
+bits of toasted bread.
--- /dev/null
+GRAVY SOUP.
+
+Get eight pounds of coarse lean beef--wash it clean and lay it in your
+pot, put in the same ingredients as for the shin soup, with the same
+quantity of water, and follow the process directed for that. Strain the
+soup through a sieve, and serve it up clear, with nothing more than
+toasted bread in it; two table-spoonsful of mushroom catsup will add a
+fine flavour to the soup.
--- /dev/null
+OYSTER SOUP.
+
+Wash and drain two quarts of oysters, put them on with three quarts of
+water, three onions chopped up, two or three slices of lean ham, pepper
+and salt; boil it till reduced one-half, strain it through a sieve,
+return the liquid into the pot, put in one quart of fresh oysters, boil
+it till they are sufficiently done, and thicken the soup with four
+spoonsful of flour, two gills of rich cream, and the yelks of six new
+laid eggs beaten well; boil it a few minutes after the thickening is put
+in. Take care that it does not curdle, and that the flour is not in
+lumps; serve it up with the last oysters that were put in. If the
+flavour of thyme be agreeable, you may put in a little, but take care
+that it does not boil in it long enough to discolour the soup.
--- /dev/null
+VEAL SOUP!
+
+Put into a pot three quarts of water, three onions cut small, one
+spoonful of black pepper pounded, and two of salt, with two or three
+slices of lean ham; let it boil steadily two hours; skim it
+occasionally, then put into it a shin of veal, let it boil two hours
+longer. take out the slices of ham, and skim off the grease if any
+should rise, take a gill of good cream, mix with it two table-spoonsful
+of flour very nicely, and the yelks of two eggs beaten well, strain this
+mixture, and add some chopped parsley; pour some soup on by degrees,
+stir it well, and pour it into the pot, continuing to stir until it has
+boiled two or three minutes to take off the raw taste of the eggs. If
+the cream be not perfectly sweet, and the eggs quite new, the thickening
+will curdle in the soup. For a change you may put a dozen ripe tomatos
+in, first taking off their skins, by letting them stand a few minutes in
+hot water, when they may be easily peeled. When made in this way you
+must thicken it with the flour only. Any part of the veal may be used,
+but the shin or knuckle is the nicest.