summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-02-27 14:21:41 -0800
committerRussell Belfer <rb@github.com>2013-02-27 14:21:41 -0800
commit9f9477d650c33eddad9cb48c5ec84cd703300c16 (patch)
treef330271c19e79af2be3153ff260879a15293f86f /src
parentc493f8211fd48fd1fabcb80465d63ecf095d062e (diff)
parent395509ffcd5007d8fa9ecccdf2090c5ed24c00e6 (diff)
downloadlibgit2-9f9477d650c33eddad9cb48c5ec84cd703300c16.tar.gz
Merge pull request #1372 from ethomson/checkout_workdir_end
don't dereference at the end of the workdir iterator
Diffstat (limited to 'src')
-rw-r--r--src/checkout.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/checkout.c b/src/checkout.c
index 59cd218a9..eda3e0b4b 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -456,7 +456,7 @@ static int checkout_action(
while (1) {
if (!wd)
return checkout_action_no_wd(data, delta);
-
+
cmp = strcomp(wd->path, delta->old_file.path);
/* 1. wd before delta ("a/a" before "a/b")
@@ -475,6 +475,8 @@ static int checkout_action(
/* case 2 - entry prefixed by workdir tree */
if (git_iterator_advance_into_directory(workdir, &wd) < 0)
goto fail;
+
+ *wditem_ptr = wd;
continue;
}
@@ -608,7 +610,7 @@ static int checkout_get_actions(
if (act & CHECKOUT_ACTION__CONFLICT)
counts[CHECKOUT_ACTION__CONFLICT]++;
}
-
+
error = checkout_remaining_wd_items(data, workdir, wditem, &pathspec);
if (error < 0)
goto fail;