Skip to content

Commit 5504f13

Browse files
pyokagangitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fa14ee7 commit 5504f13

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

t/t5521-pull-options.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,17 @@ test_expect_success 'git pull --all' '
117117
)
118118
'
119119

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+
120133
test_done

0 commit comments

Comments
 (0)