From: Junio C Hamano Date: Tue, 19 Apr 2016 23:02:22 GMT Subject: Re: [PATCH 4/6] Convert struct name_entry to use struct object_id. Message-ID: In-Reply-To: <1460934641-435791-5-git-send-email-sandals@crustytoothpaste.net> "brian m. carlson" writes: > @@ -314,7 +314,7 @@ static int threeway_callback(int n, unsigned long mask, unsigned long dirmask, s > } > > if (same_entry(entry+0, entry+1)) { > - if (entry[2].sha1 && !S_ISDIR(entry[2].mode)) { > + if (entry[2].oid->hash && !S_ISDIR(entry[2].mode)) { Thanks for a warning in the cover letter. "if (entry[2].oid && !S_ISDIR(entry[2].mode)" would be a faithful conversion, wouldn't it? threeway-callback is called from the unpack-trees codepath and tree-walk.c::traverse_trees() is what prepared these entries. An entry[] which is an N-element array represents the traversal state of walking N trees in parallel, and the callback function like this one gets an entry that has been tree-walk.c::entry_clear()ed (i.e. memset to full of '\0's) for a tree that lacks the corresponding path. Try to do merge-tree of two trees, where there is a path that we did not change since common ancestor, while the other side removed it, and you would hit this if () statement, I would think.