git-add -u: match the index with working tree.
[gitweb.git] / builtin-ls-tree.c
index 261147fdbe76cf9d277bd420cc17efedecc2da2f..6472610ac2fecb8096ecab8fe29331a6fd6c009b 100644 (file)
@@ -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;