Suggest use of "git add file1 file2" when there is nothing to commit.
[gitweb.git] / builtin-commit-tree.c
index 9c987966711d4bff1f709df0c14071170950e21d..856f3cd841818bdad4446b3f7b75d5ab22959788 100644 (file)
@@ -69,7 +69,7 @@ static int new_parent(int idx)
        int i;
        unsigned char *sha1 = parent_sha1[idx];
        for (i = 0; i < idx; i++) {
-               if (!memcmp(parent_sha1[i], sha1, 20)) {
+               if (!hashcmp(parent_sha1[i], sha1)) {
                        error("duplicate parent %s ignored", sha1_to_hex(sha1));
                        return 0;
                }
@@ -107,8 +107,6 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
                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));