diff --git a/parse-options-cb.c b/parse-options-cb.c index d99d688d3c..b2aa62a9dc 100644 --- a/parse-options-cb.c +++ b/parse-options-cb.c @@ -30,8 +30,6 @@ int parse_opt_abbrev_cb(const struct option *opt, const char *arg, int unset) opt->long_name); if (v && v < MINIMUM_ABBREV) v = MINIMUM_ABBREV; - else if (startup_info->have_repository && v > the_hash_algo->hexsz) - v = the_hash_algo->hexsz; } *(int *)(opt->value) = v; return 0; diff --git a/t/t4202-log.sh b/t/t4202-log.sh index e97826458c..51f7beb59f 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -1243,12 +1243,24 @@ test_expect_success '--abbrev-commit with core.abbrev=false' ' test_cmp expect actual ' +test_expect_success '--abbrev-commit with --no-abbrev' ' + git log --no-abbrev >expect && + git log --abbrev-commit --no-abbrev >actual && + test_cmp expect actual +' + test_expect_success '--abbrev-commit with core.abbrev=9000' ' git log --no-abbrev >expect && git -c core.abbrev=9000 log --abbrev-commit >actual && test_cmp expect actual ' +test_expect_success '--abbrev-commit with --abbrev=9000' ' + git log --no-abbrev >expect && + git log --abbrev-commit --abbrev=9000 >actual && + test_cmp expect actual +' + test_expect_success 'show added path under "--follow -M"' ' # This tests for a regression introduced in v1.7.2-rc0~103^2~2 test_create_repo regression &&