From: Junio C Hamano Date: Mon, 25 Jul 2011 17:38:50 GMT Subject: Re: [PATCH v3 2/2] Ensure git ls-tree exits with a non-zero exit code if read_tree_recursive fails. Message-ID: <7vmxg2s1jp.fsf@alter.siamese.dyndns.org> In-Reply-To: Jon Seymour writes: > @@ -173,6 +173,7 @@ int cmd_ls_tree(int argc, const char **argv, const > char *prefix) > tree = parse_tree_indirect(sha1); > if (!tree) > die("not a tree object"); > - return read_tree_recursive(tree, "", 0, 0, &pathspec, show_tree, NULL); > + ret = read_tree_recursive(tree, "", 0, 0, &pathspec, show_tree, NULL); > > + return ret ? 1 : 0; > } Surely, or "return !!read_tree_recursive(...);" is fine as well.