Skip to content

Commit c3c3486

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 033abf9 commit c3c3486

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

git-compat-util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ int git_qsort_s(void *base, size_t nmemb, size_t size,
10521052

10531053
#define QSORT_S(base, n, compar, ctx) do { \
10541054
if (qsort_s((base), (n), sizeof(*(base)), compar, ctx)) \
1055-
die("BUG: qsort_s() failed"); \
1055+
BUG("qsort_s() failed"); \
10561056
} while (0)
10571057

10581058
#ifndef REG_STARTEND

pathspec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static void init_pathspec_item(struct pathspec_item *item, unsigned flags,
486486
/* sanity checks, pathspec matchers assume these are sane */
487487
if (item->nowildcard_len > item->len ||
488488
item->prefix > item->len) {
489-
die ("BUG: error initializing pathspec_item");
489+
BUG("error initializing pathspec_item");
490490
}
491491
}
492492

submodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2043,7 +2043,7 @@ const char *get_superproject_working_tree(void)
20432043

20442044
if (super_sub_len > cwd_len ||
20452045
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?");
20472047

20482048
super_wt = xstrdup(cwd);
20492049
super_wt[cwd_len - super_sub_len] = '\0';

vcs-svn/fast_export.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@ const char *fast_export_read_path(const char *path, uint32_t *mode_out)
320320
err = fast_export_ls(path, mode_out, &buf);
321321
if (err) {
322322
if (errno != ENOENT)
323-
die_errno("BUG: unexpected fast_export_ls error");
323+
BUG("unexpected fast_export_ls error: %s",
324+
strerror(errno));
324325
/* Treat missing paths as directories. */
325326
*mode_out = S_IFDIR;
326327
return NULL;
@@ -338,7 +339,8 @@ void fast_export_copy(uint32_t revision, const char *src, const char *dst)
338339
err = fast_export_ls_rev(revision, src, &mode, &data);
339340
if (err) {
340341
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));
342344
fast_export_delete(dst);
343345
return;
344346
}

0 commit comments

Comments
 (0)