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
26564d80
Commit
26564d80
authored
Apr 23, 2014
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge: default checkout strategy for should be SAFE
parent
212b6205
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
+18
-1
src/merge.c
+1
-1
tests/merge/workdir/dirty.c
+17
-0
No files found.
src/merge.c
View file @
26564d80
...
@@ -2186,7 +2186,7 @@ static int merge_normalize_checkout_opts(
...
@@ -2186,7 +2186,7 @@ static int merge_normalize_checkout_opts(
const
git_merge_head
**
their_heads
)
const
git_merge_head
**
their_heads
)
{
{
int
error
=
0
;
int
error
=
0
;
unsigned
int
default_checkout_strategy
=
GIT_CHECKOUT_SAFE
_CREATE
|
unsigned
int
default_checkout_strategy
=
GIT_CHECKOUT_SAFE
|
GIT_CHECKOUT_ALLOW_CONFLICTS
;
GIT_CHECKOUT_ALLOW_CONFLICTS
;
GIT_UNUSED
(
repo
);
GIT_UNUSED
(
repo
);
...
...
tests/merge/workdir/dirty.c
View file @
26564d80
...
@@ -260,6 +260,23 @@ void test_merge_workdir_dirty__unaffected_dirty_files_allowed(void)
...
@@ -260,6 +260,23 @@ void test_merge_workdir_dirty__unaffected_dirty_files_allowed(void)
cl_git_pass
(
merge_dirty_files
(
files
));
cl_git_pass
(
merge_dirty_files
(
files
));
}
}
void
test_merge_workdir_dirty__unstaged_deletes_maintained
(
void
)
{
git_reference
*
head
;
git_object
*
head_object
;
cl_git_pass
(
git_repository_head
(
&
head
,
repo
));
cl_git_pass
(
git_reference_peel
(
&
head_object
,
head
,
GIT_OBJ_COMMIT
));
cl_git_pass
(
git_reset
(
repo
,
head_object
,
GIT_RESET_HARD
,
NULL
,
NULL
));
cl_git_pass
(
p_unlink
(
"merge-resolve/unchanged.txt"
));
cl_git_pass
(
merge_branch
(
0
,
0
));
git_object_free
(
head_object
);
git_reference_free
(
head
);
}
void
test_merge_workdir_dirty__affected_dirty_files_disallowed
(
void
)
void
test_merge_workdir_dirty__affected_dirty_files_disallowed
(
void
)
{
{
char
**
files
;
char
**
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