- To show only error text instead of full usage message
- Adds exits to callback function in parse-options-cb.c instead of returning -1 
which results in display of usage message.
---
 parse-options-cb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/parse-options-cb.c b/parse-options-cb.c
index 239898d..b7321d1 100644
--- a/parse-options-cb.c
+++ b/parse-options-cb.c
@@ -85,8 +85,10 @@ int parse_opt_commits(const struct option *opt, const char 
*arg, int unset)
 
        if (!arg)
                return -1;
-       if (get_sha1(arg, sha1))
-               return error("malformed object name %s", arg);
+       if (get_sha1(arg, sha1)) {
+               error("malformed object name %s", arg);
+               exit(129);
+       }
        commit = lookup_commit_reference(sha1);
        if (!commit)
                return error("no such commit %s", arg);
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to