summaryrefslogtreecommitdiff
path: root/tests/diff/stats.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-10-04 11:19:28 +0200
committerPatrick Steinhardt <ps@pks.im>2018-10-04 11:26:24 +0200
commite5090ee329aecdc2a298e442868cbf1d4b10d0e9 (patch)
tree954fe48c57b851d49aa689d3c03a6a47b897dde1 /tests/diff/stats.c
parent3148efd2ee750d879493839f751fa1f80ec0612b (diff)
downloadlibgit2-e5090ee329aecdc2a298e442868cbf1d4b10d0e9.tar.gz
diff_stats: use git's formatting of renames with common directories
In cases where a file gets renamed such that the directories containing it previous and after the rename have a common prefix, then git will avoid printing this prefix twice and instead format the rename as "prefix/{old => new}". We currently didn't do anything like that, but simply printed "prefix/old -> prefix/new". Adjust our behaviour to instead match upstream. Adjust the test for this behaviour to expect the new format.
Diffstat (limited to 'tests/diff/stats.c')
-rw-r--r--tests/diff/stats.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/diff/stats.c b/tests/diff/stats.c
index 1149b5067..150355686 100644
--- a/tests/diff/stats.c
+++ b/tests/diff/stats.c
@@ -214,7 +214,7 @@ void test_diff_stats__rename_in_subdirectory(void)
{
git_buf buf = GIT_BUF_INIT;
const char *stat =
- " dir/orig.txt => dir/renamed.txt | 0\n"
+ " dir/{orig.txt => renamed.txt} | 0\n"
" 1 file changed, 0 insertions(+), 0 deletions(-)\n";
diff_stats_from_commit_oid(