Re: [PATCH v3 2/2] Ensure git ls-tree exits with a non-zero exit code if read_tree_recursive fails.
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Jul 25, 2011, 01:31 UTC
- Message-ID
- <CACsJy8Aa_=BvZOt58sM4dknVzvihH9OtHAS1aRxqPwNLxh0fkg@mail.gmail.com>
- In-Reply-To
- <1311519554-16587-3-git-send-email-jon.seymour@gmail.com>
On Sun, Jul 24, 2011 at 9:59 PM, Jon Seymour <jon.seymour@gmail.com> wrote:
Show 8 quoted lines
> @@ -173,7 +173,6 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
> tree = parse_tree_indirect(sha1);
> if (!tree)
> die("not a tree object");
> - read_tree_recursive(tree, "", 0, 0, &pathspec, show_tree, NULL);
> + return read_tree_recursive(tree, "", 0, 0, &pathspec, show_tree, NULL);
>
> - return 0;Nit picking. Most programs return positive value (usually 1) for error cases here. read_tree_recursive may return -1 (which turns out to be 255). Also removing the last blank line in this function would be nice.
-- Duy