gitweb: Allow search to be disabled from the config file.
[gitweb.git] / builtin-commit-tree.c
index e2e690a1ae89b47f595288e452da10113f7b2e8f..bc28770664aac2c51bdd83125f36e2b15903535c 100644 (file)
@@ -101,14 +101,15 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
                a = argv[i]; b = argv[i+1];
                if (!b || strcmp(a, "-p"))
                        usage(commit_tree_usage);
+
+               if (parents >= MAXPARENT)
+                       die("Too many parents (%d max)", MAXPARENT);
                if (get_sha1(b, parent_sha1[parents]))
                        die("Not a valid object name %s", b);
                check_valid(parent_sha1[parents], commit_type);
                if (new_parent(parents))
                        parents++;
        }
-       if (!parents)
-               fprintf(stderr, "Committing initial tree %s\n", argv[1]);
 
        init_buffer(&buffer, &size);
        add_buffer(&buffer, &size, "tree %s\n", sha1_to_hex(tree_sha1));