Convert remaining die*(BUG) messages
These were not caught by the previous commit, as they did not match the regular expression. While at it, remove the localization from one instance: we never want BUG() messages to be translated, as they target Git developers, not the end user (hence it would be quite unhelpful to not only burden the translators, but then even end up with a bug report in a language that no core Git contributor understands). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
May 2, 2018 at 11:38 UTC
c3c3486b246fffef82b5541ca2d2850b2fcf34d5
4 files changed
+7
-5
git-compat-util.h
+1
-1
@@ -1052,7 +1052,7 @@ int git_qsort_s(void *base, size_t nmemb, size_t size,
1052
1053
#define QSORT_S(base, n, compar, ctx) do { \
1054
if (qsort_s((base), (n), sizeof(*(base)), compar, ctx)) \
1055
- die("BUG: qsort_s() failed"); \
1055
+ BUG("qsort_s() failed"); \
1056
} while (0)
1057
1058
#ifndef REG_STARTEND
pathspec.c
+1
-1
@@ -486,7 +486,7 @@ static void init_pathspec_item(struct pathspec_item *item, unsigned flags,
486
/* sanity checks, pathspec matchers assume these are sane */
487
if (item->nowildcard_len > item->len ||
488
item->prefix > item->len) {
489
- die ("BUG: error initializing pathspec_item");
489
+ BUG("error initializing pathspec_item");
490
}
491
}
492
submodule.c
+1
-1
@@ -2043,7 +2043,7 @@ const char *get_superproject_working_tree(void)
2043
2044
if (super_sub_len > cwd_len ||
2045
strcmp(&cwd[cwd_len - super_sub_len], super_sub))
2046
- die (_("BUG: returned path string doesn't match cwd?"));
2046
+ BUG("returned path string doesn't match cwd?");
2047
2048
super_wt = xstrdup(cwd);
2049
super_wt[cwd_len - super_sub_len] = '\0';
vcs-svn/fast_export.c
+4
-2
@@ -320,7 +320,8 @@ const char *fast_export_read_path(const char *path, uint32_t *mode_out)
320
err = fast_export_ls(path, mode_out, &buf);
321
if (err) {
322
if (errno != ENOENT)
323
- die_errno("BUG: unexpected fast_export_ls error");
323
+ BUG("unexpected fast_export_ls error: %s",
324
+ strerror(errno));
325
/* Treat missing paths as directories. */
326
*mode_out = S_IFDIR;
327
return NULL;
@@ -338,7 +339,8 @@ void fast_export_copy(uint32_t revision, const char *src, const char *dst)
339
err = fast_export_ls_rev(revision, src, &mode, &data);
340
if (err) {
341
if (errno != ENOENT)
341
- die_errno("BUG: unexpected fast_export_ls_rev error");
342
+ BUG("unexpected fast_export_ls_rev error: %s",
343
+ strerror(errno));
344
fast_export_delete(dst);
345
return;
346
}