X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=revision.c;h=c51ea833f94f96b0cc0199f27a6b72f9e78ddb26;hb=097dc3d8c32f4b85bf9701d5e1de98999ac25c1c;hp=c6e8702f380ccb9be914ae7608e9f6c3ec77d796;hpb=d820f918711446a74cc74577f6f2535a78752708;p=git.git diff --git a/revision.c b/revision.c index c6e8702f..c51ea833 100644 --- a/revision.c +++ b/revision.c @@ -63,14 +63,13 @@ void mark_tree_uninteresting(struct tree *tree) return; if (parse_tree(tree) < 0) die("bad tree %s", sha1_to_hex(obj->sha1)); - entry = tree->entries; - tree->entries = NULL; + entry = create_tree_entry_list(tree); while (entry) { struct tree_entry_list *next = entry->next; if (entry->directory) - mark_tree_uninteresting(entry->item.tree); + mark_tree_uninteresting(lookup_tree(entry->sha1)); else - mark_blob_uninteresting(entry->item.blob); + mark_blob_uninteresting(lookup_blob(entry->sha1)); free(entry); entry = next; } @@ -694,6 +693,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch } if (!strcmp(arg, "-c")) { revs->diff = 1; + revs->dense_combined_merges = 0; revs->combine_merges = 1; continue; } @@ -732,6 +732,14 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch revs->abbrev = DEFAULT_ABBREV; continue; } + if (!strncmp(arg, "--abbrev=", 9)) { + revs->abbrev = strtoul(arg + 9, NULL, 10); + if (revs->abbrev < MINIMUM_ABBREV) + revs->abbrev = MINIMUM_ABBREV; + else if (revs->abbrev > 40) + revs->abbrev = 40; + continue; + } if (!strcmp(arg, "--abbrev-commit")) { revs->abbrev_commit = 1; continue; @@ -793,7 +801,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch local_flags = UNINTERESTING; arg++; } - if (get_sha1(arg, sha1) < 0) { + if (get_sha1(arg, sha1)) { int j; if (seen_dashdash || local_flags) @@ -819,7 +827,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch if (def && !revs->pending_objects) { unsigned char sha1[20]; struct object *object; - if (get_sha1(def, sha1) < 0) + if (get_sha1(def, sha1)) die("bad default revision '%s'", def); object = get_reference(revs, def, sha1, 0); add_pending_object(revs, object, def);