Skip to content

Commit

Permalink
Fix up previous commit
Browse files Browse the repository at this point in the history
Add '-R' flag to diff-tree, and change the test subdirectory
shell files to be executable (something that Junio couldn't
get me to do through the pure patch with my current patch
handling infrastructure).
  • Loading branch information
Linus Torvalds committed May 20, 2005
1 parent 57fe64a commit de809db
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions diff-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ static int read_stdin = 0;
static int line_termination = '\n';
static int generate_patch = 0;
static int detect_rename = 0;
static int reverse_diff = 0;
static int diff_score_opt = 0;
static const char *header = NULL;
static const char *header_prefix = "";
Expand Down Expand Up @@ -270,7 +271,7 @@ static int diff_tree_sha1_top(const unsigned char *old,
{
int ret;

diff_setup(detect_rename, diff_score_opt, 0,
diff_setup(detect_rename, diff_score_opt, reverse_diff,
(generate_patch ? -1 : line_termination),
0, 0);
ret = diff_tree_sha1(old, new, base);
Expand All @@ -284,7 +285,7 @@ static int diff_root_tree(const unsigned char *new, const char *base)
void *tree;
unsigned long size;

diff_setup(detect_rename, diff_score_opt, 0,
diff_setup(detect_rename, diff_score_opt, reverse_diff,
(generate_patch ? -1 : line_termination),
0, 0);
tree = read_object_with_reference(new, "tree", &size, 0);
Expand Down Expand Up @@ -429,7 +430,7 @@ static int diff_tree_stdin(char *line)
}

static char *diff_tree_usage =
"git-diff-tree [-p] [-r] [-z] [--stdin] [-M] [-m] [-s] [-v] <tree-ish> <tree-ish>";
"git-diff-tree [-p] [-r] [-z] [--stdin] [-M] [-R] [-m] [-s] [-v] <tree-ish> <tree-ish>";

int main(int argc, char **argv)
{
Expand Down Expand Up @@ -464,6 +465,10 @@ int main(int argc, char **argv)
recursive = 1;
continue;
}
if (!strcmp(arg, "-R")) {
reverse_diff = 1;
continue;
}
if (!strcmp(arg, "-p")) {
recursive = generate_patch = 1;
continue;
Expand Down
Empty file modified t/t0110-environment-names-old.sh
100644 → 100755
Empty file.
Empty file modified t/t1000-read-tree-m-3way.sh
100644 → 100755
Empty file.
Empty file modified t/t2002-checkout-cache-u.sh
100644 → 100755
Empty file.
Empty file modified t/t4000-diff-format.sh
100644 → 100755
Empty file.
Empty file modified t/t4001-diff-rename.sh
100644 → 100755
Empty file.

0 comments on commit de809db

Please sign in to comment.