Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2013-03-29 20:26:12 +0400
committerEdward Thomson <ethomson@microsoft.com>2013-03-29 21:07:00 +0400
commit54a1a042910968441c668f3302f724e733354746 (patch)
treea958aeff5589f6286010f0e13e6063bd7c930de8 /src/checkout.c
parent8cfd54f0d831922c58e62e5f69f364ede0cea89f (diff)
remove unmerged files during reset hard
Diffstat (limited to 'src/checkout.c')
-rw-r--r--src/checkout.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/checkout.c b/src/checkout.c
index 2a29b1862..24fa21024 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -235,10 +235,13 @@ static int checkout_action_wd_only(
/* check if item is tracked in the index but not in the checkout diff */
if (data->index != NULL) {
if (wd->mode != GIT_FILEMODE_TREE) {
- if (git_index_get_bypath(data->index, wd->path, 0) != NULL) {
+ int error;
+
+ if ((error = git_index_find(NULL, data->index, wd->path)) == 0) {
notify = GIT_CHECKOUT_NOTIFY_DIRTY;
remove = ((data->strategy & GIT_CHECKOUT_FORCE) != 0);
- }
+ } else if (error != GIT_ENOTFOUND)
+ return error;
} else {
/* for tree entries, we have to see if there are any index
* entries that are contained inside that tree