diff options
author | Vicent Marti <vicent@github.com> | 2014-05-28 13:55:57 +0200 |
---|---|---|
committer | Vicent Marti <vicent@github.com> | 2014-05-28 13:55:57 +0200 |
commit | 5d91bea22ac8edc9da3b8196e68dbed5ec9a11b9 (patch) | |
tree | 52e66636edfdb9a3b382abcde80e27ee00236241 /tests | |
parent | a470a5c71b723d81108f0b2632b9cb39a5ee2d4b (diff) | |
parent | 052a2ffde4d8cf0d2b07c70956631d97875ad5ec (diff) | |
download | libgit2-5d91bea22ac8edc9da3b8196e68dbed5ec9a11b9.tar.gz |
Merge pull request #2380 from libgit2/cmn/index-add-modes
index: check for valid filemodes on add
Diffstat (limited to 'tests')
-rw-r--r-- | tests/index/filemodes.c | 15 |
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)); +} |