]> git.ipfire.org Git - thirdparty/git.git/blobdiff - diff-tree.c
[PATCH] diff: Clean up diff_scoreopt_parse().
[thirdparty/git.git] / diff-tree.c
index c3a5617c578d3a863b9759967e9583c0c5c944ea..3881c23ca37a86c41ec12b2d5c4713ab01cc9d82 100644 (file)
@@ -459,16 +459,19 @@ int main(int argc, const char **argv)
                }
                if (!strncmp(arg, "-M", 2)) {
                        detect_rename = DIFF_DETECT_RENAME;
-                       diff_score_opt = diff_scoreopt_parse(arg);
+                       if ((diff_score_opt = diff_scoreopt_parse(arg)) == -1)
+                               usage(diff_tree_usage);
                        continue;
                }
                if (!strncmp(arg, "-C", 2)) {
                        detect_rename = DIFF_DETECT_COPY;
-                       diff_score_opt = diff_scoreopt_parse(arg);
+                       if ((diff_score_opt = diff_scoreopt_parse(arg)) == -1)
+                               usage(diff_tree_usage);
                        continue;
                }
                if (!strncmp(arg, "-B", 2)) {
-                       diff_break_opt = diff_scoreopt_parse(arg);
+                       if ((diff_break_opt = diff_scoreopt_parse(arg)) == -1)
+                               usage(diff_tree_usage);
                        continue;
                }
                if (!strcmp(arg, "-z")) {