list-objects-filter: use BUG rather than die
In some cases in this file, BUG makes more sense than die. In such cases, a we get there from a coding error rather than a user error. 'return' has been removed following some instances of BUG since BUG does not return. Signed-off-by: Matthew DeVore <matvore@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
99c9aa9579
commit
696aa73905
@@ -44,8 +44,7 @@ static enum list_objects_filter_result filter_blobs_none(
|
|||||||
|
|
||||||
switch (filter_situation) {
|
switch (filter_situation) {
|
||||||
default:
|
default:
|
||||||
die("unknown filter_situation");
|
BUG("unknown filter_situation: %d", filter_situation);
|
||||||
return LOFR_ZERO;
|
|
||||||
|
|
||||||
case LOFS_BEGIN_TREE:
|
case LOFS_BEGIN_TREE:
|
||||||
assert(obj->type == OBJ_TREE);
|
assert(obj->type == OBJ_TREE);
|
||||||
@@ -102,8 +101,7 @@ static enum list_objects_filter_result filter_blobs_limit(
|
|||||||
|
|
||||||
switch (filter_situation) {
|
switch (filter_situation) {
|
||||||
default:
|
default:
|
||||||
die("unknown filter_situation");
|
BUG("unknown filter_situation: %d", filter_situation);
|
||||||
return LOFR_ZERO;
|
|
||||||
|
|
||||||
case LOFS_BEGIN_TREE:
|
case LOFS_BEGIN_TREE:
|
||||||
assert(obj->type == OBJ_TREE);
|
assert(obj->type == OBJ_TREE);
|
||||||
@@ -208,8 +206,7 @@ static enum list_objects_filter_result filter_sparse(
|
|||||||
|
|
||||||
switch (filter_situation) {
|
switch (filter_situation) {
|
||||||
default:
|
default:
|
||||||
die("unknown filter_situation");
|
BUG("unknown filter_situation: %d", filter_situation);
|
||||||
return LOFR_ZERO;
|
|
||||||
|
|
||||||
case LOFS_BEGIN_TREE:
|
case LOFS_BEGIN_TREE:
|
||||||
assert(obj->type == OBJ_TREE);
|
assert(obj->type == OBJ_TREE);
|
||||||
@@ -389,7 +386,7 @@ void *list_objects_filter__init(
|
|||||||
assert((sizeof(s_filters) / sizeof(s_filters[0])) == LOFC__COUNT);
|
assert((sizeof(s_filters) / sizeof(s_filters[0])) == LOFC__COUNT);
|
||||||
|
|
||||||
if (filter_options->choice >= LOFC__COUNT)
|
if (filter_options->choice >= LOFC__COUNT)
|
||||||
die("invalid list-objects filter choice: %d",
|
BUG("invalid list-objects filter choice: %d",
|
||||||
filter_options->choice);
|
filter_options->choice);
|
||||||
|
|
||||||
init_fn = s_filters[filter_options->choice];
|
init_fn = s_filters[filter_options->choice];
|
||||||
|
|||||||
Reference in New Issue
Block a user