From 14c3c80c81418e00ee990a88f526ac851411f422 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Wed, 2 May 2018 00:25:33 +0000 Subject: packfile: convert has_sha1_pack to object_id Convert this function to take a pointer to struct object_id and rename it has_object_pack for consistency with has_object_file. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- revision.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'revision.c') diff --git a/revision.c b/revision.c index b42c836d7a..ce0e7b71f2 100644 --- a/revision.c +++ b/revision.c @@ -3086,7 +3086,7 @@ enum commit_action get_commit_action(struct rev_info *revs, struct commit *commi { if (commit->object.flags & SHOWN) return commit_ignore; - if (revs->unpacked && has_sha1_pack(commit->object.oid.hash)) + if (revs->unpacked && has_object_pack(&commit->object.oid)) return commit_ignore; if (commit->object.flags & UNINTERESTING) return commit_ignore; -- cgit v1.2.1 From fd521245e6a2dc3c84500980951d07947f862183 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Wed, 2 May 2018 00:25:50 +0000 Subject: revision: replace use of hard-coded constants Replace two uses of the hard-coded constant 40 with references to the_hash_algo. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- revision.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'revision.c') diff --git a/revision.c b/revision.c index ce0e7b71f2..daf7fe6ff4 100644 --- a/revision.c +++ b/revision.c @@ -1751,6 +1751,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg const char *arg = argv[0]; const char *optarg; int argcount; + const unsigned hexsz = the_hash_algo->hexsz; /* pseudo revision arguments */ if (!strcmp(arg, "--all") || !strcmp(arg, "--branches") || @@ -2038,8 +2039,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg revs->abbrev = strtoul(optarg, NULL, 10); if (revs->abbrev < MINIMUM_ABBREV) revs->abbrev = MINIMUM_ABBREV; - else if (revs->abbrev > 40) - revs->abbrev = 40; + else if (revs->abbrev > hexsz) + revs->abbrev = hexsz; } else if (!strcmp(arg, "--abbrev-commit")) { revs->abbrev_commit = 1; revs->abbrev_commit_given = 1; -- cgit v1.2.1