vendor/libgit2/src/checkout.c in rugged-0.25.0b8 vs vendor/libgit2/src/checkout.c in rugged-0.25.0b9
- old
+ new
@@ -210,9 +210,13 @@
* the actual size of the data, so we can't rely on this shortcut.
*/
if (baseitem->size && wditem->file_size != baseitem->size)
return true;
+ /* if the workdir item is a directory, it cannot be a modified file */
+ if (S_ISDIR(wditem->mode))
+ return false;
+
if (git_diff__oid_for_entry(&oid, data->diff, wditem, wditem->mode, NULL) < 0)
return false;
/* Allow the checkout if the workdir is not modified *or* if the checkout
* target's contents are already in the working directory.