abspath: add absolute_pathdup()
[gitweb.git] / trailer.c
index 8e48a5c9909ec7e8ba44e5b0678455b4dc8d2d02..aecaf9232a92fcab4996037fc779e0165750fb36 100644 (file)
--- a/trailer.c
+++ b/trailer.c
@@ -428,12 +428,9 @@ static int set_if_missing(struct conf_info *item, const char *value)
 static void duplicate_conf(struct conf_info *dst, struct conf_info *src)
 {
        *dst = *src;
-       if (src->name)
-               dst->name = xstrdup(src->name);
-       if (src->key)
-               dst->key = xstrdup(src->key);
-       if (src->command)
-               dst->command = xstrdup(src->command);
+       dst->name = xstrdup_or_null(src->name);
+       dst->key = xstrdup_or_null(src->key);
+       dst->command = xstrdup_or_null(src->command);
 }
 
 static struct trailer_item *get_conf_item(const char *name)
@@ -562,7 +559,7 @@ static int git_trailer_config(const char *conf_key, const char *value, void *cb)
                        warning(_("unknown value '%s' for key '%s'"), value, conf_key);
                break;
        default:
-               die("internal bug in trailer.c");
+               die("BUG: trailer.c: unhandled type %d", type);
        }
        return 0;
 }