parse-options: don't emit "ambiguous option" for aliases
[gitweb.git] / parse-options-cb.c
index 2733393546d4d4dd9a55c5934531398f4a827ead..6e2e8d6273a2b3c35248a956f77a19925ded3e7d 100644 (file)
@@ -22,8 +22,8 @@ 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 (v > 40)
-                       v = 40;
+               else if (v > the_hash_algo->hexsz)
+                       v = the_hash_algo->hexsz;
        }
        *(int *)(opt->value) = v;
        return 0;