]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Convert remaining die*(BUG) messages
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 2 May 2018 09:38:41 +0000 (11:38 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 6 May 2018 10:06:14 +0000 (19:06 +0900)
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>
git-compat-util.h
pathspec.c
submodule.c
vcs-svn/fast_export.c

index 07e383257b4985f7400f167d683a5fb692237d93..3a7216f53138d53544c4805c96bd6ec6df99d844 100644 (file)
@@ -1052,7 +1052,7 @@ int git_qsort_s(void *base, size_t nmemb, size_t size,
 
 #define QSORT_S(base, n, compar, ctx) do {                     \
        if (qsort_s((base), (n), sizeof(*(base)), compar, ctx)) \
-               die("BUG: qsort_s() failed");                   \
+               BUG("qsort_s() failed");                        \
 } while (0)
 
 #ifndef REG_STARTEND
index a637a6d15c00fed5237bce2edec1a3a905801b8d..27cd6067860d4fdb0b48b6bcf7c84d5903efd71b 100644 (file)
@@ -486,7 +486,7 @@ static void init_pathspec_item(struct pathspec_item *item, unsigned flags,
        /* sanity checks, pathspec matchers assume these are sane */
        if (item->nowildcard_len > item->len ||
            item->prefix         > item->len) {
-               die ("BUG: error initializing pathspec_item");
+               BUG("error initializing pathspec_item");
        }
 }
 
index 733db441714a43571c6fb98a49bdd9bd274701bd..c282fa8fe51601c2a877d121a5b2491bbb3f1620 100644 (file)
@@ -2043,7 +2043,7 @@ const char *get_superproject_working_tree(void)
 
                if (super_sub_len > cwd_len ||
                    strcmp(&cwd[cwd_len - super_sub_len], super_sub))
-                       die (_("BUG: returned path string doesn't match cwd?"));
+                       BUG("returned path string doesn't match cwd?");
 
                super_wt = xstrdup(cwd);
                super_wt[cwd_len - super_sub_len] = '\0';
index 3fd047a8b82b1c2a6b32ec0a5ded3d67913b5be0..b5b8913cb0f2ceae60c18123d979e2948c568151 100644 (file)
@@ -320,7 +320,8 @@ const char *fast_export_read_path(const char *path, uint32_t *mode_out)
        err = fast_export_ls(path, mode_out, &buf);
        if (err) {
                if (errno != ENOENT)
-                       die_errno("BUG: unexpected fast_export_ls error");
+                       BUG("unexpected fast_export_ls error: %s",
+                           strerror(errno));
                /* Treat missing paths as directories. */
                *mode_out = S_IFDIR;
                return NULL;
@@ -338,7 +339,8 @@ void fast_export_copy(uint32_t revision, const char *src, const char *dst)
        err = fast_export_ls_rev(revision, src, &mode, &data);
        if (err) {
                if (errno != ENOENT)
-                       die_errno("BUG: unexpected fast_export_ls_rev error");
+                       BUG("unexpected fast_export_ls_rev error: %s",
+                           strerror(errno));
                fast_export_delete(dst);
                return;
        }