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
e8d373c4
Commit
e8d373c4
authored
Nov 11, 2017
by
Etiene Dalcol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge: add error handling for index reload
Cleans up should git_repository_index or git_index_read fail
parent
5248a1a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
src/merge.c
+4
-3
No files found.
src/merge.c
View file @
e8d373c4
...
...
@@ -3239,9 +3239,6 @@ int git_merge(
assert
(
repo
&&
their_heads
);
git_repository_index
(
&
index
,
repo
);
git_index_read
(
index
,
0
);
if
(
their_heads_len
!=
1
)
{
giterr_set
(
GITERR_MERGE
,
"can only merge a single branch"
);
return
-
1
;
...
...
@@ -3258,6 +3255,10 @@ int git_merge(
&
checkout_strategy
))
<
0
)
goto
done
;
if
((
error
=
git_repository_index
(
&
index
,
repo
)
<
0
)
||
(
error
=
git_index_read
(
index
,
0
)
<
0
))
goto
done
;
/* Write the merge setup files to the repository. */
if
((
error
=
git_annotated_commit_from_head
(
&
our_head
,
repo
))
<
0
||
(
error
=
git_merge__setup
(
repo
,
our_head
,
their_heads
,
...
...
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