Skip to content

Commit

Permalink
submodule: fix style in function definition
Browse files Browse the repository at this point in the history
The definitions of 'verify_submodule_committish()' and
'print_submodule_summary()' had wrong styling in terms of the asterisk
placement. Amend them.

Also, the warning printed in case of an unexpected file mode printed the
mode in decimal. Print it in octal for enhanced readability.

Reported-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
periperidip authored and gitster committed Aug 25, 2020
1 parent e0f7ae5 commit f0c6b64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions builtin/submodule--helper.c
Expand Up @@ -959,7 +959,7 @@ enum diff_cmd {
DIFF_FILES
};

static char* verify_submodule_committish(const char *sm_path,
static char *verify_submodule_committish(const char *sm_path,
const char *committish)
{
struct child_process cp_rev_parse = CHILD_PROCESS_INIT;
Expand All @@ -979,7 +979,7 @@ static char* verify_submodule_committish(const char *sm_path,
return strbuf_detach(&result, NULL);
}

static void print_submodule_summary(struct summary_cb *info, char* errmsg,
static void print_submodule_summary(struct summary_cb *info, char *errmsg,
int total_commits, const char *displaypath,
const char *src_abbrev, const char *dst_abbrev,
struct module_cb *p)
Expand Down Expand Up @@ -1056,7 +1056,7 @@ static void generate_submodule_summary(struct summary_cb *info,
} else {
/* for a submodule removal (mode:0000000), don't warn */
if (p->mod_dst)
warning(_("unexpected mode %d\n"), p->mod_dst);
warning(_("unexpected mode %o\n"), p->mod_dst);
}
}

Expand Down

0 comments on commit f0c6b64

Please sign in to comment.