test_expect_success 'avoid unnecessary update, normal rename' '
git checkout -q avoid-unnecessary-update-1^0 &&
- test-chmtime =1000000000 rename &&
- test-chmtime -v +0 rename >expect &&
+ test-tool chmtime =1000000000 rename &&
+ test-tool chmtime -v +0 rename >expect &&
git merge merge-branch-1 &&
- test-chmtime -v +0 rename >actual &&
+ test-tool chmtime -v +0 rename >actual &&
test_cmp expect actual # "rename" should have stayed intact
'
test_expect_success 'avoid unnecessary update, with D/F conflict' '
git checkout -q avoid-unnecessary-update-2^0 &&
- test-chmtime =1000000000 df &&
- test-chmtime -v +0 df >expect &&
+ test-tool chmtime =1000000000 df &&
+ test-tool chmtime -v +0 df >expect &&
git merge merge-branch-2 &&
- test-chmtime -v +0 df >actual &&
+ test-tool chmtime -v +0 df >actual &&
test_cmp expect actual # "df" should have stayed intact
'
test_expect_success 'avoid unnecessary update, dir->(file,nothing)' '
git checkout -q master^0 &&
- test-chmtime =1000000000 df &&
- test-chmtime -v +0 df >expect &&
+ test-tool chmtime =1000000000 df &&
+ test-tool chmtime -v +0 df >expect &&
git merge side &&
- test-chmtime -v +0 df >actual &&
+ test-tool chmtime -v +0 df >actual &&
test_cmp expect actual # "df" should have stayed intact
'
test_expect_success 'avoid unnecessary update, modify/delete' '
git checkout -q master^0 &&
- test-chmtime =1000000000 file &&
- test-chmtime -v +0 file >expect &&
+ test-tool chmtime =1000000000 file &&
+ test-tool chmtime -v +0 file >expect &&
test_must_fail git merge side &&
- test-chmtime -v +0 file >actual &&
+ test-tool chmtime -v +0 file >actual &&
test_cmp expect actual # "file" should have stayed intact
'
test_expect_success 'avoid unnecessary update, rename/add-dest' '
git checkout -q master^0 &&
- test-chmtime =1000000000 newfile &&
- test-chmtime -v +0 newfile >expect &&
+ test-tool chmtime =1000000000 newfile &&
+ test-tool chmtime -v +0 newfile >expect &&
git merge side &&
- test-chmtime -v +0 newfile >actual &&
+ test-tool chmtime -v +0 newfile >actual &&
test_cmp expect actual # "file" should have stayed intact
'