use default file permissions when installing "bad" symlinks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/lib/worktree.c b/lib/worktree.c
index f7a5187..7bb6476 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -1223,7 +1223,7 @@ install_symlink(struct got_worktree *worktree, const char *ondisk_path,
/* Path too long; install as a regular file. */
got_object_blob_rewind(blob);
return install_blob(worktree, ondisk_path, path,
- GOT_DEFAULT_FILE_MODE, st_mode, blob,
+ GOT_DEFAULT_FILE_MODE, GOT_DEFAULT_FILE_MODE, blob,
restoring_missing_file, reverting_versioned_file,
1, repo, progress_cb, progress_arg);
}
@@ -1273,7 +1273,7 @@ install_symlink(struct got_worktree *worktree, const char *ondisk_path,
/* install as a regular file */
got_object_blob_rewind(blob);
err = install_blob(worktree, ondisk_path, path,
- GOT_DEFAULT_FILE_MODE, st_mode, blob,
+ GOT_DEFAULT_FILE_MODE, GOT_DEFAULT_FILE_MODE, blob,
restoring_missing_file, reverting_versioned_file, 1,
repo, progress_cb, progress_arg);
goto done;
@@ -1290,7 +1290,7 @@ install_symlink(struct got_worktree *worktree, const char *ondisk_path,
/* install as a regular file */
got_object_blob_rewind(blob);
err = install_blob(worktree, ondisk_path, path,
- GOT_DEFAULT_FILE_MODE, st_mode, blob,
+ GOT_DEFAULT_FILE_MODE, GOT_DEFAULT_FILE_MODE, blob,
restoring_missing_file, reverting_versioned_file, 1,
repo, progress_cb, progress_arg);
goto done;
@@ -1334,7 +1334,7 @@ install_symlink(struct got_worktree *worktree, const char *ondisk_path,
/* bad target path; install as a regular file */
got_object_blob_rewind(blob);
err = install_blob(worktree, ondisk_path, path,
- GOT_DEFAULT_FILE_MODE, st_mode, blob,
+ GOT_DEFAULT_FILE_MODE, GOT_DEFAULT_FILE_MODE, blob,
restoring_missing_file, reverting_versioned_file, 1,
repo, progress_cb, progress_arg);
} else if (errno == ENOTDIR) {