shithub: git9

Download patch

ref: 972518e469bfacee38782551f1911e7ef10efb95
parent: 71093e5b397c81607f8062fe15cb5a6158ddb13c
author: Ori Bernstein <[email protected]>
date: Sun Jan 26 12:01:22 EST 2020

improve error messages

--- a/query.c
+++ b/query.c
@@ -128,7 +128,7 @@
 {
 	int i, j, n;
 	Hash *h;
-	char *p, *e;
+	char *p, *e, *s;
 	char query[2048];
 
 	ARGBEGIN{
@@ -139,12 +139,15 @@
 
 	gitinit();
 	fmtinstall('P', Pfmt);
+	s = "";
 	p = query;
 	e = query + nelem(query);
-	for(i = 0; i < argc; i++)
-		p = seprint(p, e, "%s ", argv[i]);
+	for(i = 0; i < argc; i++){
+		p = seprint(p, e, "%s%s", s, argv[i]);
+		s = " ";
+	}
 	if((n = resolverefs(&h, query)) == -1)
-		sysfatal("resolve %s: %r", query);
+		sysfatal("resolve: %r");
 	if(changes){
 		if(n != 2)
 			sysfatal("diff: need 2 commits, got %d", n);