diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2007-07-25 23:14:54 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-07-25 21:35:17 -0700 |
commit | b87841e1645f900fbec0a937a45f98b70b5684ca (patch) | |
tree | 11a0b6034e19f01516cc8a74740b36960c393bd7 /builtin-write-tree.c | |
parent | e7a7be8831b159b9a7331b34c3ec6915d4a72190 (diff) | |
download | git-b87841e1645f900fbec0a937a45f98b70b5684ca.tar.gz |
git-write-tree should not crash if prefix does not exist
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-write-tree.c')
-rw-r--r-- | builtin-write-tree.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-write-tree.c b/builtin-write-tree.c index 391de53972..88f34ba7d6 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 |