Skip to content

Commit

Permalink
t5521: test --dry-run does not make any changes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Tan authored and Junio C Hamano committed May 29, 2015
1 parent fa14ee7 commit 5504f13
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions t/t5521-pull-options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,17 @@ test_expect_success 'git pull --all' '
)
'

test_expect_success 'git pull --dry-run' '
test_when_finished "rm -rf clonedry" &&
git init 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

0 comments on commit 5504f13

Please sign in to comment.