summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Tan <pyokagan@gmail.com>2015-05-02 23:37:15 +0800
committerJunio C Hamano <gitster@pobox.com>2015-05-03 11:15:01 -0700
commit86af2d0c4cfb941c1ac491581a544939e0521e76 (patch)
treebddcd0afa394346718b5ad881d1ae96e54296e1d
parent85024ab10ebcf844481c6a8ff6bb477f53f7d603 (diff)
downloadgit-pt/pull-tests-old.tar.gz
t5521: test --dry-run does not make any changespt/pull-tests-old
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>
-rwxr-xr-xt/t5521-pull-options.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh
index 453aba53f4..7c4d624320 100755
--- a/t/t5521-pull-options.sh
+++ b/t/t5521-pull-options.sh
@@ -117,4 +117,17 @@ test_expect_success 'git pull --all' '
)
'
+test_expect_success 'git pull --dry-run' '
+ git init clonedry &&
+ test_when_finished "rm -rf clonedry" &&
+ (
+ cd clonedry &&
+ git pull --dry-run "../parent" &&
+ test_path_is_missing .git/FETCH_HEAD &&
+ test_path_is_missing .git/refs/heads/master &&
+ test_path_is_missing .git/index &&
+ test_path_is_missing "file"
+ )
+'
+
test_done