From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13094 invoked from network); 17 Apr 2022 00:39:52 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 17 Apr 2022 00:39:52 -0000 Received: from mimir.eigenstate.org ([206.124.132.107]) by 9front; Sat Apr 16 20:38:20 -0400 2022 Received: from abbatoir.myfiosgateway.com (pool-74-108-56-225.nycmny.fios.verizon.net [74.108.56.225]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id 8629e44f (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9front@9front.org>; Sat, 16 Apr 2022 17:38:08 -0700 (PDT) Message-ID: To: 9front@9front.org Date: Sat, 16 Apr 2022 20:38:06 -0400 From: ori@eigenstate.org MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: social base component-oriented SVG database standard-based controller Subject: [9front] git/send: fill in 'theirs' object, even if we miss it Reply-To: 9front@9front.org Precedence: bulk When pushing, git/send would sometimes decide we had all the objects that we'd need to update the remote, and would try to pack and send the entire history of the repository. This is because we only set the 'theirs' ref when we had the object. If we didn't have the object, we would set a zero hash, then when deciding if we needed to force, we would think that we were updating a new branch and send everything, which would fail to update the remote. --- diff 4e4ba65d588d67b17745145b99d314c9203618b8 34677e8dd3a32a9458918bd8e1300fab4694fd7e --- a/sys/src/cmd/git/send.c Sat Apr 16 20:22:43 2022 +++ b/sys/src/cmd/git/send.c Sat Apr 16 20:32:27 2022 @@ -134,8 +134,8 @@ nmap = nours; map = eamalloc(nmap, sizeof(Map)); for(i = 0; i < nmap; i++){ - map[i].ours = ours[i]; map[i].theirs = Zhash; + map[i].ours = ours[i]; map[i].ref = refs[i]; } while(1){ @@ -155,9 +155,9 @@ theirs = earealloc(theirs, ntheirs+1, sizeof(Hash)); if(hparse(&theirs[ntheirs], sp[0]) == -1) sysfatal("invalid hash %s", sp[0]); + if((idx = findkey(map, nmap, sp[1])) != -1) + map[idx].theirs = theirs[ntheirs]; if((o = readobject(theirs[ntheirs])) != nil){ - if((idx = findkey(map, nmap, sp[1])) != -1) - map[idx].theirs = theirs[ntheirs]; ntheirs++; unref(o); }