summaryrefslogtreecommitdiff
path: root/builtin/submodule--helper.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-08-31 23:18:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-09-02 16:16:24 (GMT)
commit08c2e778d6b16296aebfccd609ad09db9d40764a (patch)
treede53c515d9228c17501fab9fd9b97a58569241ee /builtin/submodule--helper.c
parent96a907376b10c42879dafc7f6b4842f8dbc04597 (diff)
downloadgit-08c2e778d6b16296aebfccd609ad09db9d40764a.zip
git-08c2e778d6b16296aebfccd609ad09db9d40764a.tar.gz
git-08c2e778d6b16296aebfccd609ad09db9d40764a.tar.bz2
submodule--helper: don't call submodule_strategy_to_string() in BUG()
Don't call submodule_strategy_to_string() in a BUG() message. These calls added in c51f8f94e5b (submodule--helper: run update procedures from C, 2021-08-24) don't need the extra information submodule_strategy_to_string() gives us, as we'll never reach the SM_UPDATE_COMMAND case here. That case is the only one where we'd get any information beyond the straightforward number-to-string mapping. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r--builtin/submodule--helper.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index f97923f..44c6dfd 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -2156,8 +2156,8 @@ static int run_update_command(const struct update_data *ud, int subforce)
must_die_on_failure = 1;
break;
default:
- BUG("unexpected update strategy type: %s",
- submodule_strategy_to_string(&ud->update_strategy));
+ BUG("unexpected update strategy type: %d",
+ ud->update_strategy.type);
}
strvec_push(&cp.args, oid);
@@ -2182,8 +2182,8 @@ static int run_update_command(const struct update_data *ud, int subforce)
ud->update_strategy.command, oid, ud->displaypath);
break;
default:
- BUG("unexpected update strategy type: %s",
- submodule_strategy_to_string(&ud->update_strategy));
+ BUG("unexpected update strategy type: %d",
+ ud->update_strategy.type);
}
if (must_die_on_failure)
exit(128);
@@ -2213,8 +2213,8 @@ static int run_update_command(const struct update_data *ud, int subforce)
ud->displaypath, ud->update_strategy.command, oid);
break;
default:
- BUG("unexpected update strategy type: %s",
- submodule_strategy_to_string(&ud->update_strategy));
+ BUG("unexpected update strategy type: %d",
+ ud->update_strategy.type);
}
return 0;