| * GIT - The information manager from hell |
| * Copyright (C) Linus Torvalds, 2005 |
| static const char write_tree_usage[] = |
| "git write-tree [--missing-ok] [--prefix=<prefix>/]"; |
| int cmd_write_tree(int argc, const char **argv, const char *unused_prefix) |
| const char *prefix = NULL; |
| const char *me = "git-write-tree"; |
| git_config(git_default_config, NULL); |
| const char *arg = argv[1]; |
| if (!strcmp(arg, "--missing-ok")) |
| else if (!prefixcmp(arg, "--prefix=")) |
| ret = write_cache_as_tree(sha1, missing_ok, prefix); |
| printf("%s\n", sha1_to_hex(sha1)); |
| case WRITE_TREE_UNREADABLE_INDEX: |
| die("%s: error reading the index", me); |
| case WRITE_TREE_UNMERGED_INDEX: |
| die("%s: error building trees; the index is unmerged?", me); |
| case WRITE_TREE_PREFIX_ERROR: |
| die("%s: prefix %s not found", me, prefix); |