Fix recreate invalid file name after delete it (#2393)

pull/2398/head
feiniks 2020-11-18 10:32:11 +08:00 committed by GitHub
parent 9fbc731504
commit 88da64bced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 12 deletions

View File

@ -5515,16 +5515,16 @@ seaf_repo_fetch_and_checkout (HttpTxTask *http_task, const char *remote_head_id)
if (de->status == DIFF_STATUS_DELETED) {
seaf_debug ("Delete file %s.\n", de->name);
if (should_ignore_on_checkout (de->name, NULL)) {
seaf_message ("Path %s is invalid on Windows, skip delete.\n",
de->name);
continue;
}
ce = index_name_exists (&istate, de->name, strlen(de->name), 0);
if (!ce)
continue;
if (should_ignore_on_checkout (de->name, NULL)) {
remove_from_index_with_prefix (&istate, de->name, NULL);
try_add_empty_parent_dir_entry (worktree, &istate, de->name);
continue;
}
gboolean locked_on_server = seaf_filelock_manager_is_file_locked (seaf->filelock_mgr,
repo_id,
de->name);
@ -5555,16 +5555,19 @@ seaf_repo_fetch_and_checkout (HttpTxTask *http_task, const char *remote_head_id)
} else if (de->status == DIFF_STATUS_DIR_DELETED) {
seaf_debug ("Delete dir %s.\n", de->name);
if (should_ignore_on_checkout (de->name, NULL)) {
seaf_message ("Path %s is invalid on Windows, skip delete.\n",
de->name);
continue;
}
/* Nothing to delete. */
if (!master_head || strcmp(master_head->root_id, EMPTY_SHA1) == 0)
continue;
if (should_ignore_on_checkout (de->name, NULL)) {
seaf_message ("Path %s is invalid on Windows, skip delete.\n",
de->name);
remove_from_index_with_prefix (&istate, de->name, NULL);
try_add_empty_parent_dir_entry (worktree, &istate, de->name);
continue;
}
delete_worktree_dir (repo_id, http_task->repo_name, &istate, worktree, de->name);
/* Remove all index entries under this directory */