test-lib: introduce test_commit_bulk
[gitweb.git] / builtin / mktree.c
index 2dc4ad6ba8f227a6a8a46bac62048959220411ec..891991b00d673457ecdc6d82d1aa400a9eff03e9 100644 (file)
@@ -67,7 +67,7 @@ static const char *mktree_usage[] = {
        NULL
 };
 
-static void mktree_line(char *buf, size_t len, int nul_term_line, int allow_missing)
+static void mktree_line(char *buf, int nul_term_line, int allow_missing)
 {
        char *ptr, *ntr;
        const char *p;
@@ -98,7 +98,7 @@ static void mktree_line(char *buf, size_t len, int nul_term_line, int allow_miss
 
        *ntr++ = 0; /* now at the beginning of SHA1 */
 
-       path = ntr + 41;  /* at the beginning of name */
+       path = (char *)p + 1;  /* at the beginning of name */
        if (!nul_term_line && path[0] == '"') {
                struct strbuf p_uq = STRBUF_INIT;
                if (unquote_c_style(&p_uq, path, NULL))
@@ -172,7 +172,7 @@ int cmd_mktree(int ac, const char **av, const char *prefix)
                                        break;
                                die("input format error: (blank line only valid in batch mode)");
                        }
-                       mktree_line(sb.buf, sb.len, nul_term_line, allow_missing);
+                       mktree_line(sb.buf, nul_term_line, allow_missing);
                }
                if (is_batch_mode && got_eof && used < 1) {
                        /*