Merge branch 'jk/rebase-am-fork-point'
[gitweb.git] / builtin / commit.c
index 72eb3beb36cd06f6e41d80d5761a953a1c3a1d56..5ed60364ce5eb1f458e1f5155d76abd7341d24ea 100644 (file)
@@ -420,8 +420,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix,
                        die(_("cannot do a partial commit during a cherry-pick."));
        }
 
-       memset(&partial, 0, sizeof(partial));
-       partial.strdup_strings = 1;
+       string_list_init(&partial, 1);
        if (list_paths(&partial, !current_head ? NULL : "HEAD", prefix, &pathspec))
                exit(1);
 
@@ -702,7 +701,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
                char *buffer;
                buffer = strstr(use_message_buffer, "\n\n");
                if (buffer)
-                       strbuf_add(&sb, buffer + 2, strlen(buffer + 2));
+                       strbuf_addstr(&sb, buffer + 2);
                hook_arg1 = "commit";
                hook_arg2 = use_message;
        } else if (fixup_message) {