diff options
author | Matti Virolainen <mvirolai@gmail.com> | 2015-06-01 11:16:36 +0300 |
---|---|---|
committer | Carlos MartÃn Nieto <cmn@dwim.me> | 2015-11-04 16:59:08 -0800 |
commit | 92471142c6a85edc75e14008fe1af89a63d4433a (patch) | |
tree | 7993ac0b961ab86f5648562aaf685c2ae0f8b285 | |
parent | d1a7d0e12a078b4f04b0106ab9be59eded8d0c52 (diff) | |
download | libgit2-92471142c6a85edc75e14008fe1af89a63d4433a.tar.gz |
Check that an executable in index is not an executable after checkout.
-rw-r--r-- | tests/checkout/tree.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/checkout/tree.c b/tests/checkout/tree.c index be4019822..577409511 100644 --- a/tests/checkout/tree.c +++ b/tests/checkout/tree.c @@ -973,6 +973,17 @@ void test_checkout_tree__filemode_preserved_in_index(void) git_commit_free(commit); + /* Finally, check out the text file again and check that the exec bit is cleared */ + cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9")); + cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid)); + + cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts)); + cl_assert(entry = git_index_get_bypath(index, "a/b.txt", 0)); + cl_assert_equal_i(0100644, entry->mode); + + git_commit_free(commit); + + git_index_free(index); } |