summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f371d3e)
raw | patch | inline | side by side (parent: f371d3e)
author | Junio C Hamano <gitster@pobox.com> | |
Sat, 6 Dec 2008 01:54:10 +0000 (17:54 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 8 Dec 2008 03:08:15 +0000 (19:08 -0800) |
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-checkout.c | patch | blob | history |
diff --git a/builtin-checkout.c b/builtin-checkout.c
index 7f3bd7bb1cb8f211c78067df9376541e0aa3f923..c2c05613b67d7cc8bd3500bdbca4fc3533afaeee 100644 (file)
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
newfd = hold_locked_index(lock_file, 1);
- read_cache();
+ if (read_cache() < 0)
+ return error("corrupt index file");
if (source_tree)
read_tree_some(source_tree, pathspec);
int ret;
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
int newfd = hold_locked_index(lock_file, 1);
- read_cache();
+
+ if (read_cache() < 0)
+ return error("corrupt index file");
if (opts->force) {
ret = reset_tree(new->commit->tree, opts, 1);