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
03bdb2ad
Commit
03bdb2ad
authored
Oct 23, 2012
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GIT_EUNMERGED
parent
632d8b23
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletions
+5
-1
include/git2/errors.h
+1
-0
src/reset.c
+1
-0
tests-clar/reset/soft.c
+3
-1
No files found.
include/git2/errors.h
View file @
03bdb2ad
...
@@ -28,6 +28,7 @@ enum {
...
@@ -28,6 +28,7 @@ enum {
GIT_EUSER
=
-
7
,
GIT_EUSER
=
-
7
,
GIT_EBAREREPO
=
-
8
,
GIT_EBAREREPO
=
-
8
,
GIT_EORPHANEDHEAD
=
-
9
,
GIT_EORPHANEDHEAD
=
-
9
,
GIT_EUNMERGED
=
-
10
,
GIT_PASSTHROUGH
=
-
30
,
GIT_PASSTHROUGH
=
-
30
,
GIT_ITEROVER
=
-
31
,
GIT_ITEROVER
=
-
31
,
...
...
src/reset.c
View file @
03bdb2ad
...
@@ -92,6 +92,7 @@ int git_reset(
...
@@ -92,6 +92,7 @@ int git_reset(
if
(
reset_type
==
GIT_RESET_SOFT
&&
(
git_repository_state
(
repo
)
==
GIT_REPOSITORY_STATE_MERGE
))
{
if
(
reset_type
==
GIT_RESET_SOFT
&&
(
git_repository_state
(
repo
)
==
GIT_REPOSITORY_STATE_MERGE
))
{
giterr_set
(
GITERR_OBJECT
,
"%s (soft) while in the middle of a merge."
,
ERROR_MSG
);
giterr_set
(
GITERR_OBJECT
,
"%s (soft) while in the middle of a merge."
,
ERROR_MSG
);
error
=
GIT_EUNMERGED
;
goto
cleanup
;
goto
cleanup
;
}
}
...
...
tests-clar/reset/soft.c
View file @
03bdb2ad
...
@@ -120,6 +120,8 @@ void test_reset_soft__fails_when_merging(void)
...
@@ -120,6 +120,8 @@ void test_reset_soft__fails_when_merging(void)
cl_git_pass
(
git_buf_joinpath
(
&
merge_head_path
,
git_repository_path
(
repo
),
"MERGE_HEAD"
));
cl_git_pass
(
git_buf_joinpath
(
&
merge_head_path
,
git_repository_path
(
repo
),
"MERGE_HEAD"
));
cl_git_mkfile
(
git_buf_cstr
(
&
merge_head_path
),
"beefbeefbeefbeefbeefbeefbeefbeefbeefbeef
\n
"
);
cl_git_mkfile
(
git_buf_cstr
(
&
merge_head_path
),
"beefbeefbeefbeefbeefbeefbeefbeefbeefbeef
\n
"
);
cl_git_fail
(
git_reset
(
repo
,
target
,
GIT_RESET_SOFT
));
retrieve_target_from_oid
(
&
target
,
repo
,
KNOWN_COMMIT_IN_BARE_REPO
);
cl_assert_equal_i
(
GIT_EUNMERGED
,
git_reset
(
repo
,
target
,
GIT_RESET_SOFT
));
cl_git_pass
(
p_unlink
(
git_buf_cstr
(
&
merge_head_path
)));
cl_git_pass
(
p_unlink
(
git_buf_cstr
(
&
merge_head_path
)));
}
}
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