git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-write-tree should not crash if prefix does not exist
@ 2007-07-26  3:14 Nguyễn Thái Ngọc Duy
  0 siblings, 0 replies; only message in thread
From: Nguyễn Thái Ngọc Duy @ 2007-07-26  3:14 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, pclouds


Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 Resend as it seems git-send-email and vger.kernel.org don't like me
 much

 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 391de53..88f34ba 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
-- 
1.5.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-26  3:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-26  3:14 [PATCH] git-write-tree should not crash if prefix does not exist Nguyễn Thái Ngọc Duy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).