diff options
author | Edward Thomson <ethomson@github.com> | 2016-10-01 19:32:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-01 19:32:16 -0500 |
commit | 9fbbb0eec5fc46cc9c36abf25b9baf653eb12372 (patch) | |
tree | fbdc0ac154ba19af9cb3938cb19aa80930947cba | |
parent | 89c332e41b12a72d89de40d63bc568c56a2c336a (diff) | |
parent | 955c99c21495841f2426733f680bdf3af9c8b593 (diff) | |
download | libgit2-9fbbb0eec5fc46cc9c36abf25b9baf653eb12372.tar.gz |
Merge pull request #3931 from libgit2/ethomson/checkout_dont_calculate_oid_for_dirs
checkout: don't try to calculate oid for directories
-rw-r--r-- | src/checkout.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/checkout.c b/src/checkout.c index f11102c8b..b3427fb7c 100644 --- a/src/checkout.c +++ b/src/checkout.c @@ -212,6 +212,10 @@ static bool checkout_is_workdir_modified( 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; |