mirror of
https://github.com/git/git.git
synced 2024-05-07 19:46:08 +02:00
submodule: rename helper functions to avoid ambiguity
The helper functions: show_submodule_summary(), prepare_submodule_summary() and print_submodule_summary() are used by the builtin_diff() function in diff.c to generate a summary of submodules in the context of a diff. Functions with similar names are to be introduced in the upcoming port of submodule's summary subcommand. So, rename the helper functions to '*_diff_submodule_summary()' to avoid ambiguity. Mentored-by: Christian Couder <chriscool@tuxfamily.org> Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com> Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
6414c3d316
commit
180b154b09
2
diff.c
2
diff.c
|
@ -3429,7 +3429,7 @@ static void builtin_diff(const char *name_a,
|
||||||
if (o->submodule_format == DIFF_SUBMODULE_LOG &&
|
if (o->submodule_format == DIFF_SUBMODULE_LOG &&
|
||||||
(!one->mode || S_ISGITLINK(one->mode)) &&
|
(!one->mode || S_ISGITLINK(one->mode)) &&
|
||||||
(!two->mode || S_ISGITLINK(two->mode))) {
|
(!two->mode || S_ISGITLINK(two->mode))) {
|
||||||
show_submodule_summary(o, one->path ? one->path : two->path,
|
show_submodule_diff_summary(o, one->path ? one->path : two->path,
|
||||||
&one->oid, &two->oid,
|
&one->oid, &two->oid,
|
||||||
two->dirty_submodule);
|
two->dirty_submodule);
|
||||||
return;
|
return;
|
||||||
|
|
10
submodule.c
10
submodule.c
|
@ -438,7 +438,7 @@ void handle_ignore_submodules_arg(struct diff_options *diffopt,
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static int prepare_submodule_summary(struct rev_info *rev, const char *path,
|
static int prepare_submodule_diff_summary(struct rev_info *rev, const char *path,
|
||||||
struct commit *left, struct commit *right,
|
struct commit *left, struct commit *right,
|
||||||
struct commit_list *merge_bases)
|
struct commit_list *merge_bases)
|
||||||
{
|
{
|
||||||
|
@ -459,7 +459,7 @@ static int prepare_submodule_summary(struct rev_info *rev, const char *path,
|
||||||
return prepare_revision_walk(rev);
|
return prepare_revision_walk(rev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_submodule_summary(struct repository *r, struct rev_info *rev, struct diff_options *o)
|
static void print_submodule_diff_summary(struct repository *r, struct rev_info *rev, struct diff_options *o)
|
||||||
{
|
{
|
||||||
static const char format[] = " %m %s";
|
static const char format[] = " %m %s";
|
||||||
struct strbuf sb = STRBUF_INIT;
|
struct strbuf sb = STRBUF_INIT;
|
||||||
|
@ -610,7 +610,7 @@ static void show_submodule_header(struct diff_options *o,
|
||||||
strbuf_release(&sb);
|
strbuf_release(&sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_submodule_summary(struct diff_options *o, const char *path,
|
void show_submodule_diff_summary(struct diff_options *o, const char *path,
|
||||||
struct object_id *one, struct object_id *two,
|
struct object_id *one, struct object_id *two,
|
||||||
unsigned dirty_submodule)
|
unsigned dirty_submodule)
|
||||||
{
|
{
|
||||||
|
@ -632,12 +632,12 @@ void show_submodule_summary(struct diff_options *o, const char *path,
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* Treat revision walker failure the same as missing commits */
|
/* Treat revision walker failure the same as missing commits */
|
||||||
if (prepare_submodule_summary(&rev, path, left, right, merge_bases)) {
|
if (prepare_submodule_diff_summary(&rev, path, left, right, merge_bases)) {
|
||||||
diff_emit_submodule_error(o, "(revision walker failed)\n");
|
diff_emit_submodule_error(o, "(revision walker failed)\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
print_submodule_summary(sub, &rev, o);
|
print_submodule_diff_summary(sub, &rev, o);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (merge_bases)
|
if (merge_bases)
|
||||||
|
|
|
@ -69,7 +69,7 @@ int parse_submodule_update_strategy(const char *value,
|
||||||
struct submodule_update_strategy *dst);
|
struct submodule_update_strategy *dst);
|
||||||
const char *submodule_strategy_to_string(const struct submodule_update_strategy *s);
|
const char *submodule_strategy_to_string(const struct submodule_update_strategy *s);
|
||||||
void handle_ignore_submodules_arg(struct diff_options *, const char *);
|
void handle_ignore_submodules_arg(struct diff_options *, const char *);
|
||||||
void show_submodule_summary(struct diff_options *o, const char *path,
|
void show_submodule_diff_summary(struct diff_options *o, const char *path,
|
||||||
struct object_id *one, struct object_id *two,
|
struct object_id *one, struct object_id *two,
|
||||||
unsigned dirty_submodule);
|
unsigned dirty_submodule);
|
||||||
void show_submodule_inline_diff(struct diff_options *o, const char *path,
|
void show_submodule_inline_diff(struct diff_options *o, const char *path,
|
||||||
|
|
Loading…
Reference in New Issue