Re: [PATCH v3 2/5] stash: convert apply to builtin
- From
Joel Teichroeb <joel@teichroeb.net>
- Date
- Mar 27, 2018, 16:20 UTC
- Message-ID
- <CA+CzEk8wUbV1mbcejyBuJ1fC87XvQPHWBNzF7qGQmLcDyytWyQ@mail.gmail.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.1803271744370.77@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>
On Tue, Mar 27, 2018 at 9:02 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 26 quoted lines
> Hi Joel,
>
> [...]
>> +
>> +static int do_apply_stash(const char *prefix, struct stash_info *info, int index)
>> +{
>> + struct merge_options o;
>> + struct object_id c_tree;
>> + struct object_id index_tree;
>> + const struct object_id *bases[1];
>> + int bases_count = 1;
>> + struct commit *result;
>> + int ret;
>> + int has_index = index;
>> +
>> + read_cache_preload(NULL);
>> + if (refresh_cache(REFRESH_QUIET))
>> + return -1;
>> +
>> + if (write_cache_as_tree(&c_tree, 0, NULL) || reset_tree(&c_tree, 0, 0))
>
> When applied on top of current `master`, I need to replace the &c_tree by
> c_tree.hash.
>
> Likewise...
>I based this revision off next because of the object_id changes. I probably should have mentioned in my cover-letter.
Show 7 quoted lines
>> [...] >> + >> + index_file = get_index_file(); >> + xsnprintf(stash_index_path, PATH_MAX, "%s.stash.%d", index_file, pid); > > Since `pid_t` is `unsigned long long` on Windows, I changed the %d" to > %"PRIuMAX and cast `pid` to `(uintmax_t)`.
Thanks for testing on windows! I'll have that fixed in the next revision.