Commit 7fa0d182b13fc09edbb6d78f68a0db455a61d0f5

Stefan Sperling 2019-08-03T16:36:22

don't forget to initialize st_mode in revert_file()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/worktree.c b/lib/worktree.c
index 7587a67..a64b0f8 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -2654,6 +2654,8 @@ revert_file(struct got_worktree *worktree, struct got_fileindex *fileindex,
 	err = get_file_status(&status, &sb, ie, ondisk_path, repo);
 	if (err)
 		goto done;
+	if (status == GOT_STATUS_MISSING || status == GOT_STATUS_DELETE)
+		sb.st_mode = got_fileindex_perms_to_st(ie);
 
 	err = got_object_id_by_path(&tree_id, repo, worktree->base_commit_id,
 	    tree_path);