-
Notifications
You must be signed in to change notification settings - Fork 0
mv from in-cone to out-of-cone #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: mv-v5
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,7 +168,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix) | |
| OPT_END(), | ||
| }; | ||
| const char **source, **destination, **dest_path, **submodule_gitfile; | ||
| enum update_mode *modes; | ||
| enum update_mode *modes, dst_mode = 0; | ||
| struct stat st; | ||
| struct string_list src_for_dst = STRING_LIST_INIT_NODUP; | ||
| struct lock_file lock_file = LOCK_INIT; | ||
|
|
@@ -207,9 +207,15 @@ int cmd_mv(int argc, const char **argv, const char *prefix) | |
| dest_path[0] = add_slash(dest_path[0]); | ||
| destination = internal_prefix_pathspec(dest_path[0], argv, argc, DUP_BASENAME); | ||
| } else { | ||
| if (argc != 1) | ||
| if (!check_dir_in_index(dest_path[0])) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The commit message mentions that this should only be done if '--sparse' is provided ("Change the logic so that when supplied with --sparse...", but I don't see any validation of that flag here. Is that done implicitly as part of 'check_dir_in_index()'? If so, it would help to have a comment in this if/else block clarifying that. |
||
| dest_path[0] = add_slash(dest_path[0]); | ||
| destination = internal_prefix_pathspec(dest_path[0], argv, argc, DUP_BASENAME); | ||
| dst_mode |= SKIP_WORKTREE_DIR; | ||
| } else if (argc != 1) { | ||
| die(_("destination '%s' is not a directory"), dest_path[0]); | ||
| destination = dest_path; | ||
| } else { | ||
| destination = dest_path; | ||
| } | ||
| } | ||
|
|
||
| /* Checking */ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.