summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-11-10 05:16:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-12 05:47:09 (GMT)
commit92ca868068a9559bf1c02f2e7b9dd443fdb4f39f (patch)
tree2b4fd4e87977e3041cad7cf1c574e61eb490210b /remote.c
parentdd509db342b8656aa9e137005639e3492f17353c (diff)
downloadgit-92ca868068a9559bf1c02f2e7b9dd443fdb4f39f.zip
git-92ca868068a9559bf1c02f2e7b9dd443fdb4f39f.tar.gz
git-92ca868068a9559bf1c02f2e7b9dd443fdb4f39f.tar.bz2
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 <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/remote.c b/remote.c
index 81f4f01..257630f 100644
--- a/remote.c
+++ b/remote.c
@@ -620,7 +620,7 @@ static void handle_duplicate(struct ref *ref1, struct ref *ref2)
* FETCH_HEAD_IGNORE entries always appear at
* the end of the list.
*/
- die(_("Internal error"));
+ BUG("Internal error");
}
}
free(ref2->peer_ref);
@@ -707,7 +707,7 @@ static void query_refspecs_multiple(struct refspec *rs,
int find_src = !query->src;
if (find_src && !query->dst)
- error("query_refspecs_multiple: need either src or dst");
+ BUG("query_refspecs_multiple: need either src or dst");
for (i = 0; i < rs->nr; i++) {
struct refspec_item *refspec = &rs->items[i];
@@ -735,7 +735,7 @@ int query_refspecs(struct refspec *rs, struct refspec_item *query)
char **result = find_src ? &query->src : &query->dst;
if (find_src && !query->dst)
- return error("query_refspecs: need either src or dst");
+ BUG("query_refspecs: need either src or dst");
for (i = 0; i < rs->nr; i++) {
struct refspec_item *refspec = &rs->items[i];