summaryrefslogtreecommitdiff
path: root/cache-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-06-10 22:04:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-06-10 22:04:15 (GMT)
commit4da14b574f2e52eb05e4fef7ed169a8f9e3a8b67 (patch)
tree134a132278b3ca34974f2812b24acb5fe9a47810 /cache-tree.c
parent28c2a3599730cca72c587bec7a9a72705635d992 (diff)
parent6d40f0ad15e72daab6524988c9c4b4a3460488f8 (diff)
downloadgit-4da14b574f2e52eb05e4fef7ed169a8f9e3a8b67.zip
git-4da14b574f2e52eb05e4fef7ed169a8f9e3a8b67.tar.gz
git-4da14b574f2e52eb05e4fef7ed169a8f9e3a8b67.tar.bz2
Merge branch 'ab/bug-if-bug'
A new bug() and BUG_if_bug() API is introduced to make it easier to uniformly log "detect multiple bugs and abort in the end" pattern. * ab/bug-if-bug: cache-tree.c: use bug() and BUG_if_bug() receive-pack: use bug() and BUG_if_bug() parse-options.c: use optbug() instead of BUG() "opts" check parse-options.c: use new bug() API for optbug() usage.c: add a non-fatal bug() function to go with BUG() common-main.c: move non-trace2 exit() behavior out of trace2.c
Diffstat (limited to 'cache-tree.c')
-rw-r--r--cache-tree.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cache-tree.c b/cache-tree.c
index a92c23e..ff794d9 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -722,14 +722,14 @@ struct tree* write_in_core_index_as_tree(struct repository *repo) {
ret = write_index_as_tree_internal(&o, index_state, was_valid, 0, NULL);
if (ret == WRITE_TREE_UNMERGED_INDEX) {
int i;
- fprintf(stderr, "BUG: There are unmerged index entries:\n");
+ bug("there are unmerged index entries:");
for (i = 0; i < index_state->cache_nr; i++) {
const struct cache_entry *ce = index_state->cache[i];
if (ce_stage(ce))
- fprintf(stderr, "BUG: %d %.*s\n", ce_stage(ce),
- (int)ce_namelen(ce), ce->name);
+ bug("%d %.*s", ce_stage(ce),
+ (int)ce_namelen(ce), ce->name);
}
- BUG("unmerged index entries when writing inmemory index");
+ BUG("unmerged index entries when writing in-core index");
}
return lookup_tree(repo, &index_state->cache_tree->oid);