summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/refs.c b/refs.c
index abc721b607..9bd0bc177b 100644
--- a/refs.c
+++ b/refs.c
@@ -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;
}