X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=revision.c;h=8d70a6f77a56d4a413e77015258db136f6cb7410;hb=2522c13244c13fe3a9f0769ea6294dce08e6596c;hp=f8ee38e54d52661cf91842e9f2fd14f74983a5d6;hpb=50c08d48722149d95f46bcc80a5211ea04b8a809;p=git.git diff --git a/revision.c b/revision.c index f8ee38e5..8d70a6f7 100644 --- a/revision.c +++ b/revision.c @@ -68,9 +68,9 @@ void mark_tree_uninteresting(struct tree *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; } @@ -733,6 +733,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; @@ -794,7 +802,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) @@ -820,7 +828,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);