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
dc83d32a
Commit
dc83d32a
authored
May 02, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1537 from ethomson/merge_warning_cleanup
puns are not funny; type punning especially so
parents
af7689ea
4e7c1560
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
14 deletions
+21
-14
src/merge.c
+16
-6
tests-clar/merge/merge_helpers.c
+3
-3
tests-clar/merge/merge_helpers.h
+2
-5
No files found.
src/merge.c
View file @
dc83d32a
...
@@ -357,7 +357,7 @@ static int merge_conflict_resolve_trivial(
...
@@ -357,7 +357,7 @@ static int merge_conflict_resolve_trivial(
git_merge_diff_list
*
diff_list
,
git_merge_diff_list
*
diff_list
,
const
git_merge_diff
*
conflict
)
const
git_merge_diff
*
conflict
)
{
{
int
ancestor_empty
,
ours_empty
,
theirs_empty
;
int
ours_empty
,
theirs_empty
;
int
ours_changed
,
theirs_changed
,
ours_theirs_differ
;
int
ours_changed
,
theirs_changed
,
ours_theirs_differ
;
git_index_entry
const
*
result
=
NULL
;
git_index_entry
const
*
result
=
NULL
;
int
error
=
0
;
int
error
=
0
;
...
@@ -374,7 +374,6 @@ static int merge_conflict_resolve_trivial(
...
@@ -374,7 +374,6 @@ static int merge_conflict_resolve_trivial(
conflict
->
their_status
==
GIT_DELTA_RENAMED
)
conflict
->
their_status
==
GIT_DELTA_RENAMED
)
return
0
;
return
0
;
ancestor_empty
=
!
GIT_MERGE_INDEX_ENTRY_EXISTS
(
conflict
->
ancestor_entry
);
ours_empty
=
!
GIT_MERGE_INDEX_ENTRY_EXISTS
(
conflict
->
our_entry
);
ours_empty
=
!
GIT_MERGE_INDEX_ENTRY_EXISTS
(
conflict
->
our_entry
);
theirs_empty
=
!
GIT_MERGE_INDEX_ENTRY_EXISTS
(
conflict
->
their_entry
);
theirs_empty
=
!
GIT_MERGE_INDEX_ENTRY_EXISTS
(
conflict
->
their_entry
);
...
@@ -678,6 +677,7 @@ static int index_entry_similarity_calc(
...
@@ -678,6 +677,7 @@ static int index_entry_similarity_calc(
{
{
git_blob
*
blob
;
git_blob
*
blob
;
git_diff_file
diff_file
=
{{{
0
}}};
git_diff_file
diff_file
=
{{{
0
}}};
git_off_t
blobsize
;
int
error
;
int
error
;
*
out
=
NULL
;
*
out
=
NULL
;
...
@@ -691,8 +691,14 @@ static int index_entry_similarity_calc(
...
@@ -691,8 +691,14 @@ static int index_entry_similarity_calc(
diff_file
.
mode
=
entry
->
mode
;
diff_file
.
mode
=
entry
->
mode
;
diff_file
.
flags
=
0
;
diff_file
.
flags
=
0
;
blobsize
=
git_blob_rawsize
(
blob
);
/* file too big for rename processing */
if
(
!
git__is_sizet
(
blobsize
))
return
0
;
error
=
opts
->
metric
->
buffer_signature
(
out
,
&
diff_file
,
error
=
opts
->
metric
->
buffer_signature
(
out
,
&
diff_file
,
git_blob_rawcontent
(
blob
),
git_blob_rawsize
(
blob
)
,
git_blob_rawcontent
(
blob
),
(
size_t
)
blobsize
,
opts
->
metric
->
payload
);
opts
->
metric
->
payload
);
git_blob_free
(
blob
);
git_blob_free
(
blob
);
...
@@ -1273,7 +1279,7 @@ int git_merge_diff_list__find_differences(
...
@@ -1273,7 +1279,7 @@ int git_merge_diff_list__find_differences(
git_vector_cmp
entry_compare
=
git_index_entry__cmp
;
git_vector_cmp
entry_compare
=
git_index_entry__cmp
;
struct
merge_diff_df_data
df_data
=
{
0
};
struct
merge_diff_df_data
df_data
=
{
0
};
int
cur_item_modified
;
int
cur_item_modified
;
size_t
i
;
size_t
i
,
j
;
int
error
=
0
;
int
error
=
0
;
assert
(
diff_list
&&
our_tree
&&
their_tree
);
assert
(
diff_list
&&
our_tree
&&
their_tree
);
...
@@ -1290,7 +1296,9 @@ int git_merge_diff_list__find_differences(
...
@@ -1290,7 +1296,9 @@ int git_merge_diff_list__find_differences(
}
}
while
(
true
)
{
while
(
true
)
{
memset
(
cur_items
,
0x0
,
sizeof
(
git_index_entry
*
)
*
3
);
for
(
i
=
0
;
i
<
3
;
i
++
)
cur_items
[
i
]
=
NULL
;
best_cur_item
=
NULL
;
best_cur_item
=
NULL
;
cur_item_modified
=
0
;
cur_item_modified
=
0
;
...
@@ -1312,7 +1320,9 @@ int git_merge_diff_list__find_differences(
...
@@ -1312,7 +1320,9 @@ int git_merge_diff_list__find_differences(
* Found an item that sorts before our current item, make
* Found an item that sorts before our current item, make
* our current item this one.
* our current item this one.
*/
*/
memset
(
cur_items
,
0x0
,
sizeof
(
git_index_entry
*
)
*
3
);
for
(
j
=
0
;
j
<
i
;
j
++
)
cur_items
[
j
]
=
NULL
;
cur_item_modified
=
1
;
cur_item_modified
=
1
;
best_cur_item
=
items
[
i
];
best_cur_item
=
items
[
i
];
cur_items
[
i
]
=
items
[
i
];
cur_items
[
i
]
=
items
[
i
];
...
...
tests-clar/merge/merge_helpers.c
View file @
dc83d32a
...
@@ -149,9 +149,9 @@ static int name_entry_eq_merge_name_entry(const struct merge_name_entry *expecte
...
@@ -149,9 +149,9 @@ static int name_entry_eq_merge_name_entry(const struct merge_name_entry *expecte
static
int
index_conflict_data_eq_merge_diff
(
const
struct
merge_index_conflict_data
*
expected
,
git_merge_diff
*
actual
)
static
int
index_conflict_data_eq_merge_diff
(
const
struct
merge_index_conflict_data
*
expected
,
git_merge_diff
*
actual
)
{
{
if
(
!
index_entry_eq_merge_index_entry
(
(
const
struct
merge_index_entry
*
)
&
expected
->
ancestor
,
&
actual
->
ancestor_entry
)
||
if
(
!
index_entry_eq_merge_index_entry
(
&
expected
->
ancestor
.
entry
,
&
actual
->
ancestor_entry
)
||
!
index_entry_eq_merge_index_entry
(
(
const
struct
merge_index_entry
*
)
&
expected
->
ours
,
&
actual
->
our_entry
)
||
!
index_entry_eq_merge_index_entry
(
&
expected
->
ours
.
entry
,
&
actual
->
our_entry
)
||
!
index_entry_eq_merge_index_entry
(
(
const
struct
merge_index_entry
*
)
&
expected
->
theirs
,
&
actual
->
their_entry
))
!
index_entry_eq_merge_index_entry
(
&
expected
->
theirs
.
entry
,
&
actual
->
their_entry
))
return
0
;
return
0
;
if
(
expected
->
ours
.
status
!=
actual
->
our_status
||
if
(
expected
->
ours
.
status
!=
actual
->
our_status
||
...
...
tests-clar/merge/merge_helpers.h
View file @
dc83d32a
...
@@ -18,11 +18,8 @@ struct merge_name_entry {
...
@@ -18,11 +18,8 @@ struct merge_name_entry {
};
};
struct
merge_index_with_status
{
struct
merge_index_with_status
{
uint16_t
mode
;
struct
merge_index_entry
entry
;
char
oid_str
[
41
];
unsigned
int
status
;
int
stage
;
char
path
[
128
];
unsigned
int
status
;
};
};
struct
merge_reuc_entry
{
struct
merge_reuc_entry
{
...
...
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