From 4a26be1befefb05c67400247fcd381b103cf3985 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 16 Nov 2011 23:09:32 -0500 Subject: [PATCH] core: diff: Correctly handle files changing type --- src/libostree/ostree-repo.c | 5 ++++- tests/t0000-basic.sh | 11 ++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index f23f0dad..fca253b1 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -2072,7 +2072,10 @@ diff_dirs (GFile *a, child_b_type = g_file_info_get_file_type (child_b_info); if (child_a_type != child_b_type) { - g_ptr_array_add (modified, g_object_ref (child_a)); + OstreeRepoDiffItem *diff_item = diff_item_new (child_a, child_a_info, + child_b, child_b_info, NULL, NULL); + + g_ptr_array_add (modified, diff_item); } else { diff --git a/tests/t0000-basic.sh b/tests/t0000-basic.sh index 1e5c84a6..1485acc2 100755 --- a/tests/t0000-basic.sh +++ b/tests/t0000-basic.sh @@ -19,7 +19,7 @@ set -e -echo "1..14" +echo "1..15" . libtest.sh @@ -110,6 +110,15 @@ cd ${test_tmpdir} assert_file_has_content diff-test2-2 'A */oh-look-a-file$' echo "ok diff cwd" +cd ${test_tmpdir}/checkout-test2-4 +rm four +mkdir four +touch four/other +$OSTREE diff test2 ./ > ${test_tmpdir}/diff-test2-2 +cd ${test_tmpdir} +assert_file_has_content diff-test2-2 'M */four$' +echo "ok diff file changing type" + cd ${test_tmpdir}/checkout-test2-4 echo afile > oh-look-a-file cat > ${test_tmpdir}/ostree-commit-metadata <