Skip to content

Commit 92ca868

Browse files
pcloudsgitster
authored andcommitted
remote.c: turn some error() or die() to BUG()
The first error, "internal error", is clearly a BUG(). The second two are meant to catch calls with invalid parameters and should never happen outside the test suite. Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dd509db commit 92ca868

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

remote.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ static void handle_duplicate(struct ref *ref1, struct ref *ref2)
620620
* FETCH_HEAD_IGNORE entries always appear at
621621
* the end of the list.
622622
*/
623-
die(_("Internal error"));
623+
BUG("Internal error");
624624
}
625625
}
626626
free(ref2->peer_ref);
@@ -707,7 +707,7 @@ static void query_refspecs_multiple(struct refspec *rs,
707707
int find_src = !query->src;
708708

709709
if (find_src && !query->dst)
710-
error("query_refspecs_multiple: need either src or dst");
710+
BUG("query_refspecs_multiple: need either src or dst");
711711

712712
for (i = 0; i < rs->nr; i++) {
713713
struct refspec_item *refspec = &rs->items[i];
@@ -735,7 +735,7 @@ int query_refspecs(struct refspec *rs, struct refspec_item *query)
735735
char **result = find_src ? &query->src : &query->dst;
736736

737737
if (find_src && !query->dst)
738-
return error("query_refspecs: need either src or dst");
738+
BUG("query_refspecs: need either src or dst");
739739

740740
for (i = 0; i < rs->nr; i++) {
741741
struct refspec_item *refspec = &rs->items[i];

0 commit comments

Comments
 (0)