Ronnie Sahlberg <sahlb...@google.com> writes:

> +     transaction = ref_transaction_begin();
> +     if ((!transaction ||
> +         ref_transaction_update(transaction, b->name, b->sha1, old_sha1,
> +                                0, 1)) ||
> +         (ref_transaction_commit(transaction, msg, &err) &&
> +          !(transaction = NULL))) {
> +             ref_transaction_rollback(transaction);
> +             return error("Unable to update branch %s: %s", b->name,
> +                          strbuf_detach(&err, NULL));
> +     }

The assigning of NULL to transaction and always returning true looks
very suspicious.

Also, if we couldn't get transaction what happens?  I think you
wanted to avoid passing NULL to rollback but at the same time I
suspect you wanted to fall into that "return error()" part, but
apparently you are failing to have that cake and eat it too, no?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to