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
0dbbfbb6
Commit
0dbbfbb6
authored
Jul 11, 2014
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2457 from ethomson/merge_fix
merge: don't open COMMIT_MSG unless we need to append conflicts
parents
eb5f0346
02bf955f
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 @
0dbbfbb6
...
...
@@ -2380,12 +2380,14 @@ int git_merge__append_conflicts_to_merge_msg(
size_t
i
;
int
error
;
if
(
!
git_index_has_conflicts
(
index
))
return
0
;
if
((
error
=
git_buf_joinpath
(
&
file_path
,
repo
->
path_repository
,
GIT_MERGE_MSG_FILE
))
<
0
||
(
error
=
git_filebuf_open
(
&
file
,
file_path
.
ptr
,
GIT_FILEBUF_APPEND
,
GIT_MERGE_FILE_MODE
))
<
0
)
goto
cleanup
;
if
(
git_index_has_conflicts
(
index
))
git_filebuf_printf
(
&
file
,
"
\n
Conflicts:
\n
"
);
git_filebuf_printf
(
&
file
,
"
\n
Conflicts:
\n
"
);
for
(
i
=
0
;
i
<
git_index_entrycount
(
index
);
i
++
)
{
const
git_index_entry
*
e
=
git_index_get_byindex
(
index
,
i
);
...
...
@@ -2410,7 +2412,6 @@ cleanup:
return
error
;
}
static
int
merge_state_cleanup
(
git_repository
*
repo
)
{
const
char
*
state_files
[]
=
{
...
...
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