diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-06-24 21:21:42 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-24 21:21:42 +0200 |
commit | a1eaf8655dcf81576f1cc6becdc63ae0de7c84d5 (patch) | |
tree | 720a2f6189c5eee246df8c88c7cf3b55d9b6f710 /t | |
parent | Merge branch 'qn/blame-show-email' (diff) | |
parent | pull: use git-rev-parse --parseopt for option parsing (diff) | |
download | git-a1eaf8655dcf81576f1cc6becdc63ae0de7c84d5.tar.xz git-a1eaf8655dcf81576f1cc6becdc63ae0de7c84d5.zip |
Merge branch 'pt/pull-optparse'
"git pull" has become more aware of the options meant for
underlying "git fetch" and then learned to use parse-options
parser.
* pt/pull-optparse:
pull: use git-rev-parse --parseopt for option parsing
pull: handle git-fetch's options as well
Diffstat (limited to 't')
-rwxr-xr-x | t/t5520-pull.sh | 20 | ||||
-rwxr-xr-x | t/t5521-pull-options.sh | 14 |
2 files changed, 34 insertions, 0 deletions
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index af31f04c28..f4a7193677 100755 --- a/t/t5520-pull.sh +++ b/t/t5520-pull.sh @@ -160,6 +160,18 @@ test_expect_success 'fail if no configuration for current branch' ' test "$(cat file)" = file ' +test_expect_success 'pull --all: fail if no configuration for current branch' ' + git remote add test_remote . && + test_when_finished "git remote remove test_remote" && + git checkout -b test copy^ && + test_when_finished "git checkout -f copy && git branch -D test" && + test_config branch.test.remote test_remote && + test "$(cat file)" = file && + test_must_fail git pull --all 2>err && + test_i18ngrep "There is no tracking information" err && + test "$(cat file)" = file +' + test_expect_success 'fail if upstream branch does not exist' ' git checkout -b test copy^ && test_when_finished "git checkout -f copy && git branch -D test" && @@ -365,6 +377,14 @@ test_expect_success '--rebase with rebased upstream' ' ' +test_expect_success '--rebase -f with rebased upstream' ' + test_when_finished "test_might_fail git rebase --abort" && + git reset --hard to-rebase-orig && + git pull --rebase -f me copy && + test "conflicting modification" = "$(cat file)" && + test file = "$(cat file2)" +' + test_expect_success '--rebase with rebased default upstream' ' git update-ref refs/remotes/me/copy copy-orig && diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh index 56e7377189..18372caa15 100755 --- a/t/t5521-pull-options.sh +++ b/t/t5521-pull-options.sh @@ -130,4 +130,18 @@ test_expect_success 'git pull --dry-run' ' ) ' +test_expect_success 'git pull --all --dry-run' ' + test_when_finished "rm -rf cloneddry" && + git init clonedry && + ( + cd clonedry && + git remote add origin ../parent && + git pull --all --dry-run && + test_path_is_missing .git/FETCH_HEAD && + test_path_is_missing .git/refs/remotes/origin/master && + test_path_is_missing .git/index && + test_path_is_missing file + ) +' + test_done |