Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
34a51428
Commit
34a51428
authored
Nov 09, 2015
by
Edward Thomson
Committed by
Edward Thomson
Nov 25, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge tests: add complex recursive example
parent
651bfd69
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
40 additions
and
6 deletions
+40
-6
tests/merge/trees/recursive.c
+28
-0
tests/resources/merge-recursive/.gitted/HEAD
+1
-1
tests/resources/merge-recursive/.gitted/index
+0
-0
tests/resources/merge-recursive/.gitted/objects/34/8f16ffaeb73f319a75cec5b16a0a47d2d5e27c
+0
-0
tests/resources/merge-recursive/.gitted/objects/48/3065df53c0f4a02cdc6b2910b05d388fc17ffb
+0
-0
tests/resources/merge-recursive/.gitted/objects/c4/83ca4bb087174af5cb51d7caa9c09fe4a28ccb
+2
-0
tests/resources/merge-recursive/.gitted/objects/d7/1c24b3b113fd1d1909998c5bfe33b86a65ee03
+0
-0
tests/resources/merge-recursive/.gitted/refs/heads/branchG-1
+1
-0
tests/resources/merge-recursive/.gitted/refs/heads/branchG-2
+1
-0
tests/resources/merge-recursive/asparagus.txt
+1
-1
tests/resources/merge-recursive/oyster.txt
+1
-1
tests/resources/merge-recursive/veal.txt
+5
-3
No files found.
tests/merge/trees/recursive.c
View file @
34a51428
...
...
@@ -269,3 +269,31 @@ void test_merge_trees_recursive__conflict(void)
git_index_free
(
index
);
}
/*
* Branch G-1 and G-2 have three common ancestors (815b5a1, ad2ace9, 483065d).
* The merge-base of the first two has two common ancestors (723181f, a34e5a1)
* which themselves have two common ancestors (8f35f30, 3a3f5a6), which
* finally has a common ancestor of 7c7bf85. This virtual merge base will
* be computed and merged with 483065d which also has a common ancestor of
* 7c7bf85.
*/
void
test_merge_trees_recursive__oh_so_many_levels_of_recursion
(
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
,
"7c7e08f9559d9e1551b91e1cf68f1d0066109add"
,
0
,
"oyster.txt"
},
{
0100644
,
"898d12687fb35be271c27c795a6b32c8b51da79e"
,
0
,
"veal.txt"
},
};
cl_git_pass
(
merge_commits_from_branches
(
&
index
,
repo
,
"branchG-1"
,
"branchG-2"
,
&
opts
));
cl_assert
(
merge_test_index
(
index
,
merge_index_entries
,
6
));
git_index_free
(
index
);
}
tests/resources/merge-recursive/.gitted/HEAD
View file @
34a51428
ref: refs/heads/branch
B-1
ref: refs/heads/branch
G-2
tests/resources/merge-recursive/.gitted/index
View file @
34a51428
No preview for this file type
tests/resources/merge-recursive/.gitted/objects/34/8f16ffaeb73f319a75cec5b16a0a47d2d5e27c
0 → 100644
View file @
34a51428
File added
tests/resources/merge-recursive/.gitted/objects/48/3065df53c0f4a02cdc6b2910b05d388fc17ffb
0 → 100644
View file @
34a51428
File added
tests/resources/merge-recursive/.gitted/objects/c4/83ca4bb087174af5cb51d7caa9c09fe4a28ccb
0 → 100644
View file @
34a51428
File added
tests/resources/merge-recursive/.gitted/objects/d7/1c24b3b113fd1d1909998c5bfe33b86a65ee03
0 → 100644
View file @
34a51428
File added
tests/resources/merge-recursive/.gitted/refs/heads/branchG-1
0 → 100644
View file @
34a51428
c483ca4bb087174af5cb51d7caa9c09fe4a28ccb
tests/resources/merge-recursive/.gitted/refs/heads/branchG-2
0 → 100644
View file @
34a51428
d71c24b3b113fd1d1909998c5bfe33b86a65ee03
tests/resources/merge-recursive/asparagus.txt
View file @
34a51428
ASPARAGUS SOUP
!
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
...
...
tests/resources/merge-recursive/oyster.txt
View file @
34a51428
OYSTER SOUP
.
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
...
...
tests/resources/merge-recursive/veal.txt
View file @
34a51428
VEAL SOUP
!
VEAL SOUP
.
P
ut into a pot three quarts of water, three onions cut small, one
P
UT INTO A POT THREE QUARTS OF WATER, 3 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
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,
...
...
@@ -16,3 +16,5 @@ 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.
This is a mighty fine recipe!
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment