Merge branch 'rs/archive-zip-raw-compression'
[gitweb.git] / revision.c
index 71e62d831229773a9af2c4a81d72be5b33d3c921..56d666d69a8a961d33651c0658f7009967e0b7ab 100644 (file)
@@ -1276,7 +1276,8 @@ static void read_revisions_from_stdin(struct rev_info *revs,
                        }
                        die("options not supported in --stdin mode");
                }
-               if (handle_revision_arg(sb.buf, revs, 0, REVARG_CANNOT_BE_FILENAME))
+               if (handle_revision_arg(xstrdup(sb.buf), revs, 0,
+                                       REVARG_CANNOT_BE_FILENAME))
                        die("bad revision '%s'", sb.buf);
        }
        if (seen_dashdash)
@@ -1970,22 +1971,6 @@ static struct merge_simplify_state *locate_simplify_state(struct rev_info *revs,
        return st;
 }
 
-static void remove_treesame_parents(struct commit *commit)
-{
-       struct commit_list **pp, *p;
-
-       pp = &commit->parents;
-       while ((p = *pp) != NULL) {
-               struct commit *parent = p->item;
-               if (parent->object.flags & TREESAME) {
-                       *pp = p->next;
-                       free(p);
-                       continue;
-               }
-               pp = &p->next;
-       }
-}
-
 static struct commit_list **simplify_one(struct rev_info *revs, struct commit *commit, struct commit_list **tail)
 {
        struct commit_list *p;
@@ -2039,17 +2024,10 @@ static struct commit_list **simplify_one(struct rev_info *revs, struct commit *c
                        break;
        }
 
-       if (revs->first_parent_only) {
+       if (revs->first_parent_only)
                cnt = 1;
-       } else {
-               /*
-                * A merge with a tree-same parent is useless
-                */
-               if (commit->parents && commit->parents->next)
-                       remove_treesame_parents(commit);
-
+       else
                cnt = remove_duplicate_parents(commit);
-       }
 
        /*
         * It is possible that we are a merge and one side branch