Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-12-15 20:39:55 +0300
committerJunio C Hamano <gitster@pobox.com>2021-12-15 20:39:55 +0300
commit159597f5a3ec881572953995f346635ab9ef8a23 (patch)
tree9e9de475ab4bfee71f41127d48496dfdddf4770c
parentb174a3c01423897154d26c96baab366229f16976 (diff)
parenteafd6e7e5585ecf7e0d4bd542d7565fea008795a (diff)
Merge branch 'ab/die-with-bug'
Code clean-up. * ab/die-with-bug: object.c: use BUG(...) no die("BUG: ...") in lookup_object_by_type() pathspec: use BUG(...) not die("BUG:%s:%d....", <file>, <line>) strbuf.h: use BUG(...) not die("BUG: ...") pack-objects: use BUG(...) not die("BUG: ...")
-rw-r--r--builtin/pack-objects.c2
-rw-r--r--object.c2
-rw-r--r--pathspec.h3
-rw-r--r--strbuf.h2
-rw-r--r--tree-diff.c3
5 files changed, 5 insertions, 7 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 857be7826f..b36ed828d8 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -3397,7 +3397,7 @@ static void read_object_list_from_stdin(void)
if (feof(stdin))
break;
if (!ferror(stdin))
- die("BUG: fgets returned NULL, not EOF, not error!");
+ BUG("fgets returned NULL, not EOF, not error!");
if (errno != EINTR)
die_errno("fgets");
clearerr(stdin);
diff --git a/object.c b/object.c
index 23a24e678a..4be82c1e7b 100644
--- a/object.c
+++ b/object.c
@@ -199,7 +199,7 @@ struct object *lookup_object_by_type(struct repository *r,
case OBJ_BLOB:
return (struct object *)lookup_blob(r, oid);
default:
- die("BUG: unknown object type %d", type);
+ BUG("unknown object type %d", type);
}
}
diff --git a/pathspec.h b/pathspec.h
index 2341dc9901..402ebb8080 100644
--- a/pathspec.h
+++ b/pathspec.h
@@ -58,8 +58,7 @@ struct pathspec {
#define GUARD_PATHSPEC(ps, mask) \
do { \
if ((ps)->magic & ~(mask)) \
- die("BUG:%s:%d: unsupported magic %x", \
- __FILE__, __LINE__, (ps)->magic & ~(mask)); \
+ BUG("unsupported magic %x", (ps)->magic & ~(mask)); \
} while (0)
/* parse_pathspec flags */
diff --git a/strbuf.h b/strbuf.h
index 96512f85b3..76965a17d4 100644
--- a/strbuf.h
+++ b/strbuf.h
@@ -160,7 +160,7 @@ void strbuf_grow(struct strbuf *sb, size_t amount);
static inline void strbuf_setlen(struct strbuf *sb, size_t len)
{
if (len > (sb->alloc ? sb->alloc - 1 : 0))
- die("BUG: strbuf_setlen() beyond buffer");
+ BUG("strbuf_setlen() beyond buffer");
sb->len = len;
if (sb->buf != strbuf_slopbuf)
sb->buf[len] = '\0';
diff --git a/tree-diff.c b/tree-diff.c
index 437c98a70e..69031d7cba 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -603,8 +603,7 @@ static void try_to_follow_renames(const struct object_id *old_oid,
* about dry-run mode and returns wildcard info.
*/
if (opt->pathspec.has_wildcard)
- die("BUG:%s:%d: wildcards are not supported",
- __FILE__, __LINE__);
+ BUG("wildcards are not supported");
#endif
/* Remove the file creation entry from the diff queue, and remember it */