summaryrefslogtreecommitdiff
path: root/builtin-checkout.c
diff options
context:
space:
mode:
authorDmitry Potapov <dpotapov@gmail.com>2008-10-05 06:14:40 +0400
committerShawn O. Pearce <spearce@spearce.org>2008-10-06 07:19:36 -0700
commit048f2762007d022defceb6850a44bc1bd5ccebf7 (patch)
treeb24ddcc05a34b4bb45331519ce76a80a62de0f51 /builtin-checkout.c
parent52e8370bc7a71366b664ece0a9ec0b79d673a356 (diff)
downloadgit-048f2762007d022defceb6850a44bc1bd5ccebf7.tar.gz
do not segfault if make_cache_entry failed
Signed-off-by: Dmitry Potapov <dpotapov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'builtin-checkout.c')
-rw-r--r--builtin-checkout.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c
index b572b3bf69..3762f71aae 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -206,6 +206,8 @@ static int checkout_merged(int pos, struct checkout *state)
ce = make_cache_entry(create_ce_mode(active_cache[pos+1]->ce_mode),
sha1,
path, 2, 0);
+ if (!ce)
+ die("make_cache_entry failed for path '%s'", path);
status = checkout_entry(ce, state, NULL);
return status;
}