Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-09-16 08:44:27 +0300
committerEdward Thomson <ethomson@microsoft.com>2015-09-16 17:33:59 +0300
commiteea7c850248c04a6ac3aadbb13b2c72c2237013b (patch)
tree4f693b9149765c90fdd77eb0bdbf959450dc87a0 /tests/checkout
parent6fe322843b98f0f9101258c88c820f230eec5f64 (diff)
checkout: overwrite files with differing modes
When a file exists on disk and we're checking out a file that differs in executableness, remove the old file. This allows us to recreate the new file with p_open, which will take the new mode into account and handle setting the umask properly. Remove any notion of chmod'ing existing files, since it is now handled by the aforementioned removal and was incorrect, as it did not take umask into account.
Diffstat (limited to 'tests/checkout')
-rw-r--r--tests/checkout/tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/checkout/tree.c b/tests/checkout/tree.c
index 5692e1f25..5680b86df 100644
--- a/tests/checkout/tree.c
+++ b/tests/checkout/tree.c
@@ -996,7 +996,8 @@ mode_t read_filemode(const char *path)
git_buf_joinpath(&fullpath, "testrepo", path);
cl_must_pass(p_stat(fullpath.ptr, &st));
- result = GIT_PERMS_IS_EXEC(st.st_mode) ? 0100755 : 0100644;
+ result = GIT_PERMS_IS_EXEC(st.st_mode) ?
+ GIT_FILEMODE_BLOB_EXECUTABLE : GIT_FILEMODE_BLOB;
git_buf_free(&fullpath);