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
7a74590d
Commit
7a74590d
authored
Dec 03, 2015
by
Stan Hu
Committed by
Edward Thomson
Mar 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rebase bug and include test for merge=union
parent
f8787098
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletions
+37
-1
src/merge.c
+1
-1
tests/merge/workdir/simple.c
+36
-0
No files found.
src/merge.c
View file @
7a74590d
...
...
@@ -1900,7 +1900,7 @@ int git_merge__iterators(
int
resolved
=
0
;
/* Check for merge options in .gitattributes */
if
((
error
=
lookup_file_favor
(
&
opts
.
file_
favor
,
repo
,
conflict
->
our_entry
.
path
)
<
0
))
if
((
error
=
lookup_file_favor
(
&
file_opts
.
favor
,
repo
,
conflict
->
our_entry
.
path
)
<
0
))
goto
done
;
if
((
error
=
merge_conflict_resolve
(
...
...
tests/merge/workdir/simple.c
View file @
7a74590d
...
...
@@ -330,6 +330,42 @@ void test_merge_workdir_simple__union(void)
cl_assert
(
merge_test_reuc
(
repo_index
,
merge_reuc_entries
,
4
));
}
void
test_merge_workdir_simple__gitattributes_union
(
void
)
{
git_buf
conflicting_buf
=
GIT_BUF_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
ADDED_IN_MASTER_INDEX_ENTRY
,
AUTOMERGEABLE_INDEX_ENTRY
,
CHANGED_IN_BRANCH_INDEX_ENTRY
,
CHANGED_IN_MASTER_INDEX_ENTRY
,
{
0100644
,
"72cdb057b340205164478565e91eb71647e66891"
,
0
,
"conflicting.txt"
},
UNCHANGED_INDEX_ENTRY
,
};
struct
merge_reuc_entry
merge_reuc_entries
[]
=
{
AUTOMERGEABLE_REUC_ENTRY
,
CONFLICTING_REUC_ENTRY
,
REMOVED_IN_BRANCH_REUC_ENTRY
,
REMOVED_IN_MASTER_REUC_ENTRY
};
set_core_autocrlf_to
(
repo
,
false
);
cl_git_mkfile
(
TEST_REPO_PATH
"/.gitattributes"
,
"conflicting.txt merge=union
\n
"
);
merge_simple_branch
(
GIT_MERGE_FILE_FAVOR_NORMAL
,
0
);
cl_git_pass
(
git_futils_readbuffer
(
&
conflicting_buf
,
TEST_REPO_PATH
"/conflicting.txt"
));
cl_assert
(
strcmp
(
conflicting_buf
.
ptr
,
CONFLICTING_UNION_FILE
)
==
0
);
git_buf_free
(
&
conflicting_buf
);
cl_assert
(
merge_test_index
(
repo_index
,
merge_index_entries
,
6
));
cl_assert
(
merge_test_reuc
(
repo_index
,
merge_reuc_entries
,
4
));
}
void
test_merge_workdir_simple__diff3_from_config
(
void
)
{
git_config
*
config
;
...
...
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