Documentation: bisect: add some titles to some paragraphs.
[gitweb.git] / builtin-read-tree.c
index 8ba436dbace7ec25ec5768a5c6c84f3202f92159..82df94101a20a9ea9c06cd6d6ce8db56d8a7de18 100644 (file)
@@ -55,8 +55,7 @@ static void prime_cache_tree_rec(struct cache_tree *it, struct tree *tree)
        int cnt;
 
        hashcpy(it->sha1, tree->object.sha1);
-       desc.buf = tree->buffer;
-       desc.size = tree->size;
+       init_tree_desc(&desc, tree->buffer, tree->size);
        cnt = 0;
        while (tree_entry(&desc, &entry)) {
                if (!S_ISDIR(entry.mode))
@@ -133,7 +132,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
                 *  entries and put the entries from the tree under the
                 * given subdirectory.
                 */
-               if (!strncmp(arg, "--prefix=", 9)) {
+               if (!prefixcmp(arg, "--prefix=")) {
                        if (stage || opts.merge || opts.prefix)
                                usage(read_tree_usage);
                        opts.prefix = arg + 9;
@@ -179,7 +178,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
                        continue;
                }
 
-               if (!strncmp(arg, "--exclude-per-directory=", 24)) {
+               if (!prefixcmp(arg, "--exclude-per-directory=")) {
                        struct dir_struct *dir;
 
                        if (opts.dir)