summaryrefslogtreecommitdiff
path: root/builtin-write-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-write-tree.c')
-rw-r--r--builtin-write-tree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin-write-tree.c b/builtin-write-tree.c
index 391de53972..b89d02efec 100644
--- a/builtin-write-tree.c
+++ b/builtin-write-tree.c
@@ -52,6 +52,8 @@ int write_tree(unsigned char *sha1, int missing_ok, const char *prefix)
if (prefix) {
struct cache_tree *subtree =
cache_tree_find(active_cache_tree, prefix);
+ if (!subtree)
+ die("git-write-tree: prefix %s not found", prefix);
hashcpy(sha1, subtree->sha1);
}
else
@@ -70,6 +72,7 @@ int cmd_write_tree(int argc, const char **argv, const char *unused_prefix)
const char *prefix = NULL;
unsigned char sha1[20];
+ git_config(git_default_config);
while (1 < argc) {
const char *arg = argv[1];
if (!strcmp(arg, "--missing-ok"))