summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-15 00:59:17 (GMT)
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-15 00:59:17 (GMT)
commite68b6f1525c670f474d735009fec419473df0962 (patch)
treec09b5a31f4557e0008ebe4da49f1b10b0765a944 /diff.c
parentc0fd1f517efeb67df32b8d4ffa209afab14be436 (diff)
downloadgit-e68b6f1525c670f474d735009fec419473df0962.zip
git-e68b6f1525c670f474d735009fec419473df0962.tar.gz
git-e68b6f1525c670f474d735009fec419473df0962.tar.bz2
Split up "diff_format" into "format" and "line_termination".
This removes the separate "formats" for name and name-with-zero- termination. It also removes the difference between HUMAN and MACHINE formats, and they both become DIFF_FORMAT_RAW, with the difference being just in the line and inter-filename termination. It also makes the code easier to understand.
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/diff.c b/diff.c
index d0962ba..3cb41c5 100644
--- a/diff.c
+++ b/diff.c
@@ -977,16 +977,14 @@ static void diff_resolve_rename_copy(void)
diff_debug_queue("resolve-rename-copy done", q);
}
-void diff_flush(int diff_output_style)
+void diff_flush(int diff_output_style, int line_termination)
{
struct diff_queue_struct *q = &diff_queued_diff;
int i;
- int line_termination = '\n';
int inter_name_termination = '\t';
- if (diff_output_style == DIFF_FORMAT_MACHINE ||
- diff_output_style == DIFF_FORMAT_NAME_Z)
- line_termination = inter_name_termination = 0;
+ if (!line_termination)
+ inter_name_termination = 0;
for (i = 0; i < q->nr; i++) {
struct diff_filepair *p = q->queue[i];
@@ -999,13 +997,11 @@ void diff_flush(int diff_output_style)
case DIFF_FORMAT_PATCH:
diff_flush_patch(p);
break;
- case DIFF_FORMAT_HUMAN:
- case DIFF_FORMAT_MACHINE:
+ case DIFF_FORMAT_RAW:
diff_flush_raw(p, line_termination,
inter_name_termination);
break;
case DIFF_FORMAT_NAME:
- case DIFF_FORMAT_NAME_Z:
diff_flush_name(p, line_termination);
break;
}