compat/poll: sleep 1 millisecond to avoid busy wait
[gitweb.git] / builtin / name-rev.c
index 20fcf8c696700993617649da77e5bbf6b416498a..0b21d7e5b297ff3d2d1a73d8a74c8bc37e672ccb 100644 (file)
@@ -27,8 +27,7 @@ static void name_rev(struct commit *commit,
        struct commit_list *parents;
        int parent_number = 1;
 
-       if (!commit->object.parsed)
-               parse_commit(commit);
+       parse_commit(commit);
 
        if (commit->date < cutoff)
                return;
@@ -101,9 +100,9 @@ static const char *name_ref_abbrev(const char *refname, int shorten_unambiguous)
 {
        if (shorten_unambiguous)
                refname = shorten_unambiguous_ref(refname, 0);
-       else if (!prefixcmp(refname, "refs/heads/"))
+       else if (starts_with(refname, "refs/heads/"))
                refname = refname + 11;
-       else if (!prefixcmp(refname, "refs/"))
+       else if (starts_with(refname, "refs/"))
                refname = refname + 5;
        return refname;
 }
@@ -149,7 +148,7 @@ static int name_ref(const char *path, const unsigned char *sha1, int flags, void
        int can_abbreviate_output = data->tags_only && data->name_only;
        int deref = 0;
 
-       if (data->tags_only && prefixcmp(path, "refs/tags/"))
+       if (data->tags_only && !starts_with(path, "refs/tags/"))
                return 0;
 
        if (data->ref_filter) {