Karthik Nayak <karthik.188@xxxxxxxxx> writes: >> Not an issue with this series at all, but one thing I wondered is if >> it makes sense to change the type of strmap_get/strmap_put to deal >> with "const void *". That way, it would not be necessary to cast >> away the constness like so: >> >>> -+ strmap_put(failed_refs, refname, ref_transaction_error_msg(err)); >>> ++ strmap_put(failed_refs, refname, (char *)ref_transaction_error_msg(err)); >> >> without harming the other side, namely >> >>> @@ builtin/receive-pack.c: static void BUG_if_skipped_connectivity_check(struct com >>> + if (reported_error) >>> + cmd->error_string = reported_error; >>> + else if (strmap_contains(&failed_refs, cmd->ref_name)) >>> -+ cmd->error_string = xstrdup(strmap_get(&failed_refs, cmd->ref_name)); >>> ++ cmd->error_string = strmap_get(&failed_refs, cmd->ref_name); >> >> this piece of code. >> >> It may not make sense, and even if it did, of course, it is totally >> outside of this series. >> >> Thanks. > > It definitely does, The only other typecast I did find for `strmap_put` > was within 'strmap.h'. Nevertheless, I think it makes sense to make that > change. strmap shouldn't modify the data provided. Perhaps #leftoverbits. OK. Thanks.