X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-ls-tree.c;h=6472610ac2fecb8096ecab8fe29331a6fd6c009b;hb=b568a503def81f49704ba94f5a822d523022102a;hp=261147fdbe76cf9d277bd420cc17efedecc2da2f;hpb=67e31d6234c0332334d7aedd70b2f101bc010cf9;p=git.git diff --git a/builtin-ls-tree.c b/builtin-ls-tree.c index 261147fdb..6472610ac 100644 --- a/builtin-ls-tree.c +++ b/builtin-ls-tree.c @@ -14,10 +14,10 @@ static int line_termination = '\n'; #define LS_TREE_ONLY 2 #define LS_SHOW_TREES 4 #define LS_NAME_ONLY 8 -static int abbrev = 0; -static int ls_options = 0; +static int abbrev; +static int ls_options; static const char **pathspec; -static int chomp_prefix = 0; +static int chomp_prefix; static const char *ls_tree_prefix; static const char ls_tree_usage[] = @@ -118,7 +118,7 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix) chomp_prefix = 0; break; } - if (!strncmp(argv[1]+2, "abbrev=",7)) { + if (!prefixcmp(argv[1]+2, "abbrev=")) { abbrev = strtoul(argv[1]+9, NULL, 10); if (abbrev && abbrev < MINIMUM_ABBREV) abbrev = MINIMUM_ABBREV;