- while (size1 | size2) {
- if (!size1) {
- show_file("+", tree2, size2);
- update_tree_entry(&tree2, &size2);
+ int nr_sha1;
+ char line[1000];
+ unsigned char sha1[2][20];
+ const char *prefix = setup_git_directory();
+
+ git_config(git_diff_config);
+ nr_sha1 = 0;
+ diff_setup(&diff_options);
+
+ for (;;) {
+ int diff_opt_cnt;
+ const char *arg;
+
+ argv++;
+ argc--;
+ arg = *argv;
+ if (!arg)
+ break;
+
+ if (*arg != '-') {
+ if (nr_sha1 < 2 && !get_sha1(arg, sha1[nr_sha1])) {
+ nr_sha1++;
+ continue;
+ }
+ break;
+ }
+
+ diff_opt_cnt = diff_opt_parse(&diff_options, argv, argc);
+ if (diff_opt_cnt < 0)
+ usage(diff_tree_usage);
+ else if (diff_opt_cnt) {
+ argv += diff_opt_cnt - 1;
+ argc -= diff_opt_cnt - 1;
+ continue;
+ }
+
+
+ if (!strcmp(arg, "--")) {
+ argv++;
+ argc--;
+ break;
+ }
+ if (!strcmp(arg, "-r")) {
+ diff_options.recursive = 1;
+ continue;
+ }
+ if (!strcmp(arg, "-t")) {
+ diff_options.recursive = 1;
+ diff_options.tree_in_recursive = 1;
+ continue;
+ }
+ if (!strcmp(arg, "-m")) {
+ ignore_merges = 0;
+ continue;
+ }
+ if (!strcmp(arg, "-v")) {
+ verbose_header = 1;
+ header_prefix = "diff-tree ";
+ continue;
+ }
+ if (!strncmp(arg, "--pretty", 8)) {
+ verbose_header = 1;
+ header_prefix = "diff-tree ";
+ commit_format = get_commit_format(arg+8);