Re: [PATCH] tree-walk: convert fill_tree_descriptor() to object_id
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Aug 12, 2017, 08:04 UTC
- Message-ID
- <fb99b685-327a-1c01-52d6-f0a1d106544c@kdbg.org>
- In-Reply-To
- <d1e4b270-4f8b-85e4-b6fd-09657720bed2@web.de>
Am 12.08.2017 um 09:14 schrieb René Scharfe:
Show 6 quoted lines
> - Initialize a `tree_desc` and decode its first entry given the sha1 of > - a tree. Returns the `buffer` member if the sha1 is a valid tree > - identifier and NULL otherwise. > + Initialize a `tree_desc` and decode its first entry given the > + object ID of a tree. Returns the `buffer` member if the sha1 is > + a valid tree identifier and NULL otherwise.
There is another mention of "sha1" in the rewritten text. Intended or an oversight?
Show 9 quoted lines
> -#define ENTRY_SHA1(e) (((e)->mode && S_ISDIR((e)->mode)) ? (e)->oid->hash : NULL) > - buf0 = fill_tree_descriptor(t+0, ENTRY_SHA1(n + 0)); > - buf1 = fill_tree_descriptor(t+1, ENTRY_SHA1(n + 1)); > - buf2 = fill_tree_descriptor(t+2, ENTRY_SHA1(n + 2)); > +#define ENTRY_OID(e) (((e)->mode && S_ISDIR((e)->mode)) ? (e)->oid : NULL) > + buf0 = fill_tree_descriptor(t + 0, ENTRY_OID(n + 0)); > + buf1 = fill_tree_descriptor(t + 1, ENTRY_OID(n + 1)); > + buf2 = fill_tree_descriptor(t + 2, ENTRY_OID(n + 2)); > #undef ENTRY_SHA1
This whould be #undef ENTRY_OID.
-- Hannes