Merge branch 'jk/log-graph-name-only'
"git log --graph" did not work well with "--name-only", even though other forms of "diff" output were handled correctly. * jk/log-graph-name-only: diff: print line prefix for --name-only output
This commit is contained in:
commit
e53c7f8731
1
diff.c
1
diff.c
@ -4450,6 +4450,7 @@ static void flush_one_pair(struct diff_filepair *p, struct diff_options *opt)
|
||||
name_a = p->two->path;
|
||||
name_b = NULL;
|
||||
strip_prefix(opt->prefix_length, &name_a, &name_b);
|
||||
fprintf(opt->file, "%s", diff_line_prefix(opt));
|
||||
write_name_quoted(name_a, opt->file, opt->line_termination);
|
||||
}
|
||||
}
|
||||
|
@ -1212,6 +1212,54 @@ test_expect_success 'log --line-prefix="*** " --graph with diff and stats' '
|
||||
test_i18ncmp expect actual.sanitized
|
||||
'
|
||||
|
||||
cat >expect <<-\EOF
|
||||
* reach
|
||||
|
|
||||
| A reach.t
|
||||
* Merge branch 'tangle'
|
||||
* Merge branch 'side'
|
||||
|\
|
||||
| * side-2
|
||||
|
|
||||
| A 2
|
||||
* Second
|
||||
|
|
||||
| A one
|
||||
* sixth
|
||||
|
||||
D a/two
|
||||
EOF
|
||||
|
||||
test_expect_success 'log --graph with --name-status' '
|
||||
git log --graph --format=%s --name-status tangle..reach >actual &&
|
||||
sanitize_output <actual >actual.sanitized &&
|
||||
test_cmp expect actual.sanitized
|
||||
'
|
||||
|
||||
cat >expect <<-\EOF
|
||||
* reach
|
||||
|
|
||||
| reach.t
|
||||
* Merge branch 'tangle'
|
||||
* Merge branch 'side'
|
||||
|\
|
||||
| * side-2
|
||||
|
|
||||
| 2
|
||||
* Second
|
||||
|
|
||||
| one
|
||||
* sixth
|
||||
|
||||
a/two
|
||||
EOF
|
||||
|
||||
test_expect_success 'log --graph with --name-only' '
|
||||
git log --graph --format=%s --name-only tangle..reach >actual &&
|
||||
sanitize_output <actual >actual.sanitized &&
|
||||
test_cmp expect actual.sanitized
|
||||
'
|
||||
|
||||
test_expect_success 'dotdot is a parent directory' '
|
||||
mkdir -p a/b &&
|
||||
( echo sixth && echo fifth ) >expect &&
|
||||
|
Loading…
Reference in New Issue
Block a user