Code

gitweb.js: Harden setting blamed commit info in incremental blame
[git.git] / commit.c
index 8f6b703c557599921d890c3b50b66eaa397de548..a47fb4da271beaf5595b6bbbe41f94bad08f404d 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -50,7 +50,6 @@ struct commit *lookup_commit(const unsigned char *sha1)
 
 static unsigned long parse_commit_date(const char *buf, const char *tail)
 {
-       unsigned long date;
        const char *dateptr;
 
        if (buf + 6 >= tail)
@@ -73,10 +72,7 @@ static unsigned long parse_commit_date(const char *buf, const char *tail)
        if (buf >= tail)
                return 0;
        /* dateptr < buf && buf[-1] == '\n', so strtoul will stop at buf-1 */
-       date = strtoul(dateptr, NULL, 10);
-       if (date == ULONG_MAX)
-               date = 0;
-       return date;
+       return strtoul(dateptr, NULL, 10);
 }
 
 static struct commit_graft **commit_graft;
@@ -316,26 +312,6 @@ int parse_commit(struct commit *item)
        return ret;
 }
 
-static void unparse_commit_list(struct commit_list *list)
-{
-       for (; list; list = list->next)
-               unparse_commit(list->item);
-}
-
-void unparse_commit(struct commit *item)
-{
-       item->object.flags = 0;
-       item->object.used = 0;
-       if (item->object.parsed) {
-               item->object.parsed = 0;
-               if (item->parents) {
-                       unparse_commit_list(item->parents);
-                       free_commit_list(item->parents);
-                       item->parents = NULL;
-               }
-       }
-}
-
 struct commit_list *commit_list_insert(struct commit *item, struct commit_list **list_p)
 {
        struct commit_list *new_list = xmalloc(sizeof(struct commit_list));