projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Audit rev-parse users.
[git.git]
/
diff.c
diff --git
a/diff.c
b/diff.c
index
36bbda6
..
3cb41c5
100644
(file)
--- a/
diff.c
+++ b/
diff.c
@@
-818,6
+818,12
@@
static void diff_flush_raw(struct diff_filepair *p,
putchar(line_termination);
}
putchar(line_termination);
}
+static void diff_flush_name(struct diff_filepair *p,
+ int line_termination)
+{
+ printf("%s%c", p->two->path, line_termination);
+}
+
int diff_unmodified_pair(struct diff_filepair *p)
{
/* This function is written stricter than necessary to support
int diff_unmodified_pair(struct diff_filepair *p)
{
/* This function is written stricter than necessary to support
@@
-971,15
+977,14
@@
static void diff_resolve_rename_copy(void)
diff_debug_queue("resolve-rename-copy done", q);
}
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;
{
struct diff_queue_struct *q = &diff_queued_diff;
int i;
- int line_termination = '\n';
int inter_name_termination = '\t';
int inter_name_termination = '\t';
- if (
diff_output_style == DIFF_FORMAT_MACHINE
)
-
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];
for (i = 0; i < q->nr; i++) {
struct diff_filepair *p = q->queue[i];
@@
-992,11
+997,13
@@
void diff_flush(int diff_output_style)
case DIFF_FORMAT_PATCH:
diff_flush_patch(p);
break;
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;
diff_flush_raw(p, line_termination,
inter_name_termination);
break;
+ case DIFF_FORMAT_NAME:
+ diff_flush_name(p, line_termination);
+ break;
}
}
for (i = 0; i < q->nr; i++)
}
}
for (i = 0; i < q->nr; i++)