diff options
Diffstat (limited to 'builtin-write-tree.c')
-rw-r--r-- | builtin-write-tree.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/builtin-write-tree.c b/builtin-write-tree.c index 9d640508dd..3a24ce8157 100644 --- a/builtin-write-tree.c +++ b/builtin-write-tree.c @@ -13,7 +13,7 @@ static const char write_tree_usage[] = int cmd_write_tree(int argc, const char **argv, const char *unused_prefix) { - int missing_ok = 0, ret; + int flags = 0, ret; const char *prefix = NULL; unsigned char sha1[20]; const char *me = "git-write-tree"; @@ -22,9 +22,15 @@ int cmd_write_tree(int argc, const char **argv, const char *unused_prefix) while (1 < argc) { const char *arg = argv[1]; if (!strcmp(arg, "--missing-ok")) - missing_ok = 1; + flags |= WRITE_TREE_MISSING_OK; else if (!prefixcmp(arg, "--prefix=")) prefix = arg + 9; + else if (!prefixcmp(arg, "--ignore-cache-tree")) + /* + * This is only useful for debugging, so I + * do not bother documenting it. + */ + flags |= WRITE_TREE_IGNORE_CACHE_TREE; else usage(write_tree_usage); argc--; argv++; @@ -33,7 +39,7 @@ int cmd_write_tree(int argc, const char **argv, const char *unused_prefix) if (argc > 2) die("too many options"); - ret = write_cache_as_tree(sha1, missing_ok, prefix); + ret = write_cache_as_tree(sha1, flags, prefix); switch (ret) { case 0: printf("%s\n", sha1_to_hex(sha1)); |