expose a helper function peel_to_type().
[gitweb.git] / builtin-rev-list.c
index 1cb5f67119a37b8490c76f4846372ba28a316fbf..9426081dae17e0a3ce536c8b4ffc038b32eda8a7 100644 (file)
@@ -520,7 +520,7 @@ static void read_revisions_from_stdin(struct rev_info *revs)
 
        while (fgets(line, sizeof(line), stdin) != NULL) {
                int len = strlen(line);
-               if (line[len - 1] == '\n')
+               if (len && line[len - 1] == '\n')
                        line[--len] = 0;
                if (!len)
                        break;
@@ -609,7 +609,8 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
        if (bisect_list)
                revs.limited = 1;
 
-       prepare_revision_walk(&revs);
+       if (prepare_revision_walk(&revs))
+               die("revision walk setup failed");
        if (revs.tree_objects)
                mark_edges_uninteresting(revs.commits, &revs, show_edge);