t5521: test --dry-run does not make any changes

Test that when --dry-run is provided to git-pull, it does not make any changes, namely: * --dry-run gets passed to git-fetch, so no FETCH_HEAD will be created and no refs will be fetched. * The index and work tree will not be modified. Signed-off-by: Paul Tan <pyokagan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Paul Tan committed May 29, 2015 at 19:44 UTC 5504f13a7c1e0a0ed486aecfdcc45b150528693e
1 file changed +13
t/t5521-pull-options.sh
+13
@@ -117,4 +117,17 @@ test_expect_success 'git pull --all' '
117 )
118 '
119
120 +test_expect_success 'git pull --dry-run' '
121 + test_when_finished "rm -rf clonedry" &&
122 + git init clonedry &&
123 + (
124 + cd clonedry &&
125 + git pull --dry-run ../parent &&
126 + test_path_is_missing .git/FETCH_HEAD &&
127 + test_path_is_missing .git/refs/heads/master &&
128 + test_path_is_missing .git/index &&
129 + test_path_is_missing file
130 + )
131 +'
132 +
133 test_done