submodule: convert check_for_new_submodule_commits to object_id
All of the callers of this function have been converted, so convert this function and update the callers. This function also calls sha1_array_append, which we'll convert shortly. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Mar 26, 2017 at 16:01 UTC
2eb80bcdcc2d16ff1e73dc2f2171f7f1ef6e9f29
3 files changed
+6
-6
builtin/fetch.c
+3
-3
@@ -659,7 +659,7 @@ static int update_local_ref(struct ref *ref,
659
660
if ((recurse_submodules != RECURSE_SUBMODULES_OFF) &&
661
(recurse_submodules != RECURSE_SUBMODULES_ON))
662
- check_for_new_submodule_commits(ref->new_oid.hash);
662
+ check_for_new_submodule_commits(&ref->new_oid);
663
r = s_update_ref(msg, ref, 0);
664
format_display(display, r ? '!' : '*', what,
665
r ? _("unable to update local ref") : NULL,
@@ -675,7 +675,7 @@ static int update_local_ref(struct ref *ref,
675
strbuf_add_unique_abbrev(&quickref, ref->new_oid.hash, DEFAULT_ABBREV);
676
if ((recurse_submodules != RECURSE_SUBMODULES_OFF) &&
677
(recurse_submodules != RECURSE_SUBMODULES_ON))
678
- check_for_new_submodule_commits(ref->new_oid.hash);
678
+ check_for_new_submodule_commits(&ref->new_oid);
679
r = s_update_ref("fast-forward", ref, 1);
680
format_display(display, r ? '!' : ' ', quickref.buf,
681
r ? _("unable to update local ref") : NULL,
@@ -690,7 +690,7 @@ static int update_local_ref(struct ref *ref,
690
strbuf_add_unique_abbrev(&quickref, ref->new_oid.hash, DEFAULT_ABBREV);
691
if ((recurse_submodules != RECURSE_SUBMODULES_OFF) &&
692
(recurse_submodules != RECURSE_SUBMODULES_ON))
693
- check_for_new_submodule_commits(ref->new_oid.hash);
693
+ check_for_new_submodule_commits(&ref->new_oid);
694
r = s_update_ref("forced-update", ref, 1);
695
format_display(display, r ? '!' : '+', quickref.buf,
696
r ? _("unable to update local ref") : _("forced update"),
submodule.c
+2
-2
@@ -821,14 +821,14 @@ static int add_sha1_to_array(const char *ref, const struct object_id *oid,
821
return 0;
822
}
823
824
-void check_for_new_submodule_commits(unsigned char new_sha1[20])
824
+void check_for_new_submodule_commits(struct object_id *oid)
825
{
826
if (!initialized_fetch_ref_tips) {
827
for_each_ref(add_sha1_to_array, &ref_tips_before_fetch);
828
initialized_fetch_ref_tips = 1;
829
}
830
831
- sha1_array_append(&ref_tips_after_fetch, new_sha1);
831
+ sha1_array_append(&ref_tips_after_fetch, oid->hash);
832
}
833
834
static int add_sha1_to_argv(const unsigned char sha1[20], void *data)
submodule.h
+1
-1
@@ -58,7 +58,7 @@ extern void show_submodule_inline_diff(FILE *f, const char *path,
58
const char *del, const char *add, const char *reset,
59
const struct diff_options *opt);
60
extern void set_config_fetch_recurse_submodules(int value);
61
-extern void check_for_new_submodule_commits(unsigned char new_sha1[20]);
61
+extern void check_for_new_submodule_commits(struct object_id *oid);
62
extern int fetch_populated_submodules(const struct argv_array *options,
63
const char *prefix, int command_line_option,
64
int quiet, int max_parallel_jobs);