merge-ort: add a new toplevel_dir field
Due to the string-equality-iff-pointer-equality requirements placed on merged_info.directory_name, apply_directory_rename_modifications() will need to have access to the exact toplevel directory name string pointer and can't just use a new empty string. Store it in a field that we can use. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
bea433655a
commit
05b85c6eeb
15
merge-ort.c
15
merge-ort.c
@ -168,12 +168,15 @@ struct merge_options_internal {
|
|||||||
struct rename_info renames;
|
struct rename_info renames;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* current_dir_name: temporary var used in collect_merge_info_callback()
|
* current_dir_name, toplevel_dir: temporary vars
|
||||||
*
|
*
|
||||||
* Used to set merged_info.directory_name; see documentation for that
|
* These are used in collect_merge_info_callback(), and will set the
|
||||||
* variable and the requirements placed on that field.
|
* various merged_info.directory_name for the various paths we get;
|
||||||
|
* see documentation for that variable and the requirements placed on
|
||||||
|
* that field.
|
||||||
*/
|
*/
|
||||||
const char *current_dir_name;
|
const char *current_dir_name;
|
||||||
|
const char *toplevel_dir;
|
||||||
|
|
||||||
/* call_depth: recursion level counter for merging merge bases */
|
/* call_depth: recursion level counter for merging merge bases */
|
||||||
int call_depth;
|
int call_depth;
|
||||||
@ -682,10 +685,10 @@ static int collect_merge_info(struct merge_options *opt,
|
|||||||
int ret;
|
int ret;
|
||||||
struct tree_desc t[3];
|
struct tree_desc t[3];
|
||||||
struct traverse_info info;
|
struct traverse_info info;
|
||||||
const char *toplevel_dir_placeholder = "";
|
|
||||||
|
|
||||||
opt->priv->current_dir_name = toplevel_dir_placeholder;
|
opt->priv->toplevel_dir = "";
|
||||||
setup_traverse_info(&info, toplevel_dir_placeholder);
|
opt->priv->current_dir_name = opt->priv->toplevel_dir;
|
||||||
|
setup_traverse_info(&info, opt->priv->toplevel_dir);
|
||||||
info.fn = collect_merge_info_callback;
|
info.fn = collect_merge_info_callback;
|
||||||
info.data = opt;
|
info.data = opt;
|
||||||
info.show_all_errors = 1;
|
info.show_all_errors = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user