[ostree] core: diff: Correctly handle files changing type



commit 4a26be1befefb05c67400247fcd381b103cf3985
Author: Colin Walters <walters verbum org>
Date:   Wed Nov 16 23:09:32 2011 -0500

    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 f23f0da..fca253b 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 1e5c84a..1485acc 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
 
@@ -111,6 +111,15 @@ 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 <<EOF
 {'origin': <'http://example.com'>, 'buildid': <@u 42>}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]