Re: [PATCH v2 0/5] roll back locks in various code paths
Jeff King <peff@peff.net> writes:
Show 22 quoted lines
> IMHO the result is easier to follow. Except for one case:
>
>> - if (active_cache_changed || force_write) {
>> - if (newfd < 0) {
>> - if (refresh_args.flags & REFRESH_QUIET)
>> - exit(128);
>> - unable_to_lock_die(get_index_file(), lock_error);
>> - }
>> - if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
>> - die("Unable to write new index file");
>> + if (newfd < 0 && (active_cache_changed || force_write)) {
>> + if (refresh_args.flags & REFRESH_QUIET)
>> + exit(128);
>> + unable_to_lock_die(get_index_file(), lock_error);
>> }
>>
>> - rollback_lock_file(&lock_file);
>> + if (write_locked_index(&the_index, &lock_file,
>> + COMMIT_LOCK | (force_write ? 0 : SKIP_IF_UNCHANGED)))
>> + die("Unable to write new index file");
>
> where I think the logic just ends up repeating itself.Yup, this one I also had a bit of trouble with.