summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-05-22 16:01:02 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-05-22 16:01:02 +0200
commit052a2ffde4d8cf0d2b07c70956631d97875ad5ec (patch)
tree3012d2ca4f8789ab794a3b2e837d315ddc687b57 /tests
parent9331f98acaffd377a8076ab111bed84ff89e8e72 (diff)
downloadlibgit2-cmn/index-add-modes.tar.gz
index: check for valid filemodes on addcmn/index-add-modes
Diffstat (limited to 'tests')
-rw-r--r--tests/index/filemodes.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/index/filemodes.c b/tests/index/filemodes.c
index 013932696..e00b9c975 100644
--- a/tests/index/filemodes.c
+++ b/tests/index/filemodes.c
@@ -152,3 +152,18 @@ void test_index_filemodes__trusted(void)
git_index_free(index);
}
+
+void test_index_filemodes__invalid(void)
+{
+ git_index *index;
+ git_index_entry entry;
+
+ cl_git_pass(git_repository_index(&index, g_repo));
+
+ entry.path = "foo";
+ entry.mode = GIT_OBJ_BLOB;
+ cl_git_fail(git_index_add(index, &entry));
+
+ entry.mode = GIT_FILEMODE_BLOB;
+ cl_git_pass(git_index_add(index, &entry));
+}