shithub: git9

Download patch

ref: 95f9b87775759e613d916690e5c7bfa68567a7be
parent: dbb282645f990d8b05ce050bf09ed79d7dcd5f8c
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Mar 10 17:07:05 EDT 2020

remove die

we have sysfatal, we don't need the die function -- it used
to be useful to abort for debugging, but this hasn't triggered
in ages.

--- a/fs.c
+++ b/fs.c
@@ -243,7 +243,7 @@
 	if(e->tree->ent[i].ismod)
 		o = emptydir();
 	else if((o = readobject(e->tree->ent[i].h)) == nil)
-		die("could not read object %H: %r", e->tree->ent[i].h, e->hash);
+		sysfatal("could not read object %H: %r", e->tree->ent[i].h);
 	if(e->tree->ent[i].islink)
 		if((l = walklink(aux, o->data, o->size, 0, &m)) != nil)
 			o = l;
@@ -367,7 +367,7 @@
 		dirread9p(r, gcommitgen, aux);
 		break;
 	default:
-		die("invalid object type %d", o->type);
+		sysfatal("invalid object type %d", o->type);
 	}
 }
 
--- a/git.h
+++ b/git.h
@@ -251,7 +251,6 @@
 int	hassuffix(char *, char *);
 int	swapsuffix(char *, int, char *, char *, char *);
 char	*strip(char *);
-void	die(char *, ...);
 
 /* proto handling */
 int	readpkt(Conn*, char*, int);
--- a/util.c
+++ b/util.c
@@ -242,14 +242,3 @@
 		*e = 0;
 	return s;
 }
-
-void
-die(char *fmt, ...)
-{
-	va_list ap;
-
-	va_start(ap, fmt);
-	vfprint(2, fmt, ap);
-	va_end(ap);
-	abort();
-}