mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-12 12:00:29 +00:00
GIT_EUNMERGED
This commit is contained in:
parent
632d8b230b
commit
03bdb2addd
@ -28,6 +28,7 @@ enum {
|
||||
GIT_EUSER = -7,
|
||||
GIT_EBAREREPO = -8,
|
||||
GIT_EORPHANEDHEAD = -9,
|
||||
GIT_EUNMERGED = -10,
|
||||
|
||||
GIT_PASSTHROUGH = -30,
|
||||
GIT_ITEROVER = -31,
|
||||
|
@ -92,6 +92,7 @@ int git_reset(
|
||||
|
||||
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);
|
||||
error = GIT_EUNMERGED;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
@ -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_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)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user