shithub: git9

Download patch

ref: df893c6891d41a7405970ad60bec8c9480b9389b
parent: 4d3ec4c90bd7fd0fb989a5259dc4d0ff07ade9d8
author: Ori Bernstein <[email protected]>
date: Tue Nov 3 01:42:55 EST 2020

git/send: fix force push when we don't have all objects

--- a/send.c
+++ b/send.c
@@ -172,9 +172,10 @@
 		u = &upd[i];
 		if(hasheq(&u->theirs, &Zhash))
 			continue;
-		if((o = readobject(u->theirs)) == nil)
+		if((o = readobject(u->theirs)) != nil)
+			pack(&skip, &skip, o);
+		if(!force && o == nil)
 			sysfatal("could not read %H", u->theirs);
-		pack(&skip, &skip, o);
 		unref(o);
 	}