Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2007-07-26 07:14:54 +0400
committerJunio C Hamano <gitster@pobox.com>2007-07-26 08:35:17 +0400
commitb87841e1645f900fbec0a937a45f98b70b5684ca (patch)
tree11a0b6034e19f01516cc8a74740b36960c393bd7 /builtin-write-tree.c
parente7a7be8831b159b9a7331b34c3ec6915d4a72190 (diff)
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.c2
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