git/send: pick minimal delta set correctly (thanks igor)

We weren't giving all objects to the twixt() function, and
it was making bad life choices -- gambling, smoking, drinking,
and packing in too much data.

With more information, it doesn't do the last.
This commit is contained in:
Ori Bernstein 2021-05-31 18:02:23 -07:00
parent c297482269
commit 1160919f81
3 changed files with 51 additions and 19 deletions

View file

@ -1326,7 +1326,7 @@ loadtree(Metavec *v, Objset *has, Hash tree, char *dpath, vlong mtime)
if(t->type != GTree){
fprint(2, "load: %H: not tree\n", t->hash);
unref(t);
return -1;
return 0;
}
addmeta(v, has, t, dpath, mtime);
for(i = 0; i < t->tree->nent; i++){
@ -1363,7 +1363,7 @@ loadcommit(Metavec *v, Objset *has, Hash h)
if(c->type != GCommit){
fprint(2, "load: %H: not commit\n", c->hash);
unref(c);
return -1;
return 0;
}
addmeta(v, has, c, "", c->commit->ctime);
r = loadtree(v, has, c->commit->tree, "", c->commit->ctime);