summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-30 05:04:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-30 05:04:07 (GMT)
commit50f08db5941755b69012378bfc86f6b8ee98edf4 (patch)
treed403a1dbf522fdaab4cf6b9b508a08b3965828e2 /wt-status.c
parentbef896e4ab414312cdca493e0306d66ec7246b01 (diff)
parent746ea4adc6cd88ad5f5af6beebace581fe489b2f (diff)
downloadgit-50f08db5941755b69012378bfc86f6b8ee98edf4.zip
git-50f08db5941755b69012378bfc86f6b8ee98edf4.tar.gz
git-50f08db5941755b69012378bfc86f6b8ee98edf4.tar.bz2
Merge branch 'js/use-bug-macro'
Developer support update, by using BUG() macro instead of die() to mark codepaths that should not happen more clearly. * js/use-bug-macro: BUG_exit_code: fix sparse "symbol not declared" warning Convert remaining die*(BUG) messages Replace all die("BUG: ...") calls by BUG() ones run-command: use BUG() to report bugs, not die() test-tool: help verifying BUG() code paths
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/wt-status.c b/wt-status.c
index 32f3bca..0cf1bed 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -264,7 +264,7 @@ static const char *wt_status_unmerged_status_string(int stagemask)
case 7:
return _("both modified:");
default:
- die("BUG: unhandled unmerged status %x", stagemask);
+ BUG("unhandled unmerged status %x", stagemask);
}
}
@@ -377,7 +377,7 @@ static void wt_longstatus_print_change_data(struct wt_status *s,
status = d->worktree_status;
break;
default:
- die("BUG: unhandled change_type %d in wt_longstatus_print_change_data",
+ BUG("unhandled change_type %d in wt_longstatus_print_change_data",
change_type);
}
@@ -395,7 +395,7 @@ static void wt_longstatus_print_change_data(struct wt_status *s,
status_printf(s, color(WT_STATUS_HEADER, s), "\t");
what = wt_status_diff_status_string(status);
if (!what)
- die("BUG: unhandled diff status %c", status);
+ BUG("unhandled diff status %c", status);
len = label_width - utf8_strwidth(what);
assert(len >= 0);
if (one_name != two_name)
@@ -470,7 +470,7 @@ static void wt_status_collect_changed_cb(struct diff_queue_struct *q,
case DIFF_STATUS_COPIED:
case DIFF_STATUS_RENAMED:
if (d->rename_status)
- die("BUG: multiple renames on the same target? how?");
+ BUG("multiple renames on the same target? how?");
d->rename_source = xstrdup(p->one->path);
d->rename_score = p->score * 100 / MAX_SCORE;
d->rename_status = p->status;
@@ -484,7 +484,7 @@ static void wt_status_collect_changed_cb(struct diff_queue_struct *q,
break;
default:
- die("BUG: unhandled diff-files status '%c'", p->status);
+ BUG("unhandled diff-files status '%c'", p->status);
break;
}
@@ -547,7 +547,7 @@ static void wt_status_collect_updated_cb(struct diff_queue_struct *q,
case DIFF_STATUS_COPIED:
case DIFF_STATUS_RENAMED:
if (d->rename_status)
- die("BUG: multiple renames on the same target? how?");
+ BUG("multiple renames on the same target? how?");
d->rename_source = xstrdup(p->one->path);
d->rename_score = p->score * 100 / MAX_SCORE;
d->rename_status = p->status;
@@ -569,7 +569,7 @@ static void wt_status_collect_updated_cb(struct diff_queue_struct *q,
break;
default:
- die("BUG: unhandled diff-index status '%c'", p->status);
+ BUG("unhandled diff-index status '%c'", p->status);
break;
}
}
@@ -2154,7 +2154,7 @@ static void wt_porcelain_v2_print_unmerged_entry(
case 6: key = "AA"; break; /* both added */
case 7: key = "UU"; break; /* both modified */
default:
- die("BUG: unhandled unmerged status %x", d->stagemask);
+ BUG("unhandled unmerged status %x", d->stagemask);
}
/*
@@ -2181,7 +2181,7 @@ static void wt_porcelain_v2_print_unmerged_entry(
sum |= (1 << (stage - 1));
}
if (sum != d->stagemask)
- die("BUG: observed stagemask 0x%x != expected stagemask 0x%x", sum, d->stagemask);
+ BUG("observed stagemask 0x%x != expected stagemask 0x%x", sum, d->stagemask);
if (s->null_termination)
path_index = it->string;
@@ -2285,7 +2285,7 @@ void wt_status_print(struct wt_status *s)
wt_porcelain_v2_print(s);
break;
case STATUS_FORMAT_UNSPECIFIED:
- die("BUG: finalize_deferred_config() should have been called");
+ BUG("finalize_deferred_config() should have been called");
break;
case STATUS_FORMAT_NONE:
case STATUS_FORMAT_LONG: