Merge branch 'jc/cocci-xstrdup-or-null'

Code cleanup.

* jc/cocci-xstrdup-or-null:
  cocci: refactor common patterns to use xstrdup_or_null()
This commit is contained in:
Junio C Hamano
2016-10-26 13:14:45 -07:00
7 changed files with 17 additions and 20 deletions

3
refs.c
View File

@ -816,8 +816,7 @@ struct ref_update *ref_transaction_add_update(
hashcpy(update->new_sha1, new_sha1);
if (flags & REF_HAVE_OLD)
hashcpy(update->old_sha1, old_sha1);
if (msg)
update->msg = xstrdup(msg);
update->msg = xstrdup_or_null(msg);
return update;
}