Commit 6598aa7e94b3b38c9345addeb0b3602aa8f151b2

John Fultz 2015-04-16T14:10:34

Oops...need bitwise, not logical negation.

diff --git a/src/checkout.c b/src/checkout.c
index 93343cc..539939e 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -1796,7 +1796,7 @@ static int checkout_create_the_new(
 	size_t i;
 	int caps = git_index_caps(data->index);
 
-	git_index_set_caps(data->index, caps & !GIT_INDEXCAP_NO_FILEMODE);
+	git_index_set_caps(data->index, caps & ~GIT_INDEXCAP_NO_FILEMODE);
 
 	git_vector_foreach(&data->diff->deltas, i, delta) {
 		if (actions[i] & CHECKOUT_ACTION__DEFER_REMOVE) {
@@ -2550,7 +2550,7 @@ cleanup:
 		(data.strategy & CHECKOUT_INDEX_DONT_WRITE_MASK) == 0)
 	{
 		int caps = git_index_caps(data.index);
-		git_index_set_caps(data.index, caps & !GIT_INDEXCAP_NO_FILEMODE);
+		git_index_set_caps(data.index, caps & ~GIT_INDEXCAP_NO_FILEMODE);
 		error = git_index_write(data.index);
 		git_index_set_caps(data.index, caps);
 	}