]> asedeno.scripts.mit.edu Git - git.git/blobdiff - commit.c
Fix make_absolute_path() for parameters without a slash
[git.git] / commit.c
index 70f12664cecbd411092703df6eae7f13e50f37fa..22ce7768639465f896e52b08a73cf5605940700b 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -311,6 +311,8 @@ int parse_commit(struct commit *item)
        unsigned long size;
        int ret;
 
+       if (!item)
+               return -1;
        if (item->object.parsed)
                return 0;
        buffer = read_sha1_file(item->object.sha1, &type, &size);
@@ -385,8 +387,7 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
 
        while (parents) {
                struct commit *commit = parents->item;
-               parse_commit(commit);
-               if (!(commit->object.flags & mark)) {
+               if (!parse_commit(commit) && !(commit->object.flags & mark)) {
                        commit->object.flags |= mark;
                        insert_by_date(commit, list);
                }