Merge branch 'jk/gitweb-with-newer-cgi-multi-param' into maint
[gitweb.git] / t / t2022-checkout-paths.sh
index 8e3545d8680c5f5179977082849388b1b31c17d8..f46d0499bc6ea95236f7ca05060b8f8fbbdbbc50 100755 (executable)
@@ -61,4 +61,21 @@ test_expect_success 'do not touch unmerged entries matching $path but not in $tr
        test_cmp expect.next0 actual.next0
 '
 
+test_expect_success 'do not touch files that are already up-to-date' '
+       git reset --hard &&
+       echo one >file1 &&
+       echo two >file2 &&
+       git add file1 file2 &&
+       git commit -m base &&
+       echo modified >file1 &&
+       test-chmtime =1000000000 file2 &&
+       git update-index -q --refresh &&
+       git checkout HEAD -- file1 file2 &&
+       echo one >expect &&
+       test_cmp expect file1 &&
+       echo "1000000000        file2" >expect &&
+       test-chmtime -v +0 file2 >actual &&
+       test_cmp expect actual
+'
+
 test_done