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:
authorDaniel Barkalow <barkalow@iabervon.org>2008-02-07 19:39:48 +0300
committerJunio C Hamano <gitster@pobox.com>2008-02-10 10:16:51 +0300
commit203a2fe117070964a5bf7cc940a742cad7a19fca (patch)
treefc0b78c0020f32ff1d55e31aca3ef4fba0a34574 /builtin-read-tree.c
parent9cb76b8cdc8ac62a77080595f6443613fd64bab3 (diff)
Allow callers of unpack_trees() to handle failure
Return an error from unpack_trees() instead of calling die(), and exit with an error in read-tree, builtin-commit, and diff-lib. merge-recursive already expected an error return from unpack_trees, so it doesn't need to be changed. The merge function can return negative to abort. This will be used in builtin-checkout -m. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Diffstat (limited to 'builtin-read-tree.c')
-rw-r--r--builtin-read-tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index 5785401753..1d9d125b91 100644
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
@@ -268,7 +268,8 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
parse_tree(tree);
init_tree_desc(t+i, tree->buffer, tree->size);
}
- unpack_trees(nr_trees, t, &opts);
+ if (unpack_trees(nr_trees, t, &opts))
+ return 128;
/*
* When reading only one tree (either the most basic form,