From b6f07e3d3f9979006214a4be176c77c95d15a23e Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Tue, 19 Aug 2008 15:18:16 -0500 Subject: [PATCH] Test for pull doing rebase. --- tests/t5200-script-pull.sh | 81 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 tests/t5200-script-pull.sh diff --git a/tests/t5200-script-pull.sh b/tests/t5200-script-pull.sh new file mode 100644 index 0000000..c782932 --- /dev/null +++ b/tests/t5200-script-pull.sh @@ -0,0 +1,81 @@ +#!/bin/sh + +test_description='script create branch' + +. ./test-lib.sh + +export PATH=$PATH:../../scripts + +test_expect_success 'setup' ' + echo "setup" >a && + git add a && + git commit -m "setup" && + git clone ./. server && + rm -fr server/.git/hooks && + git remote add origin ./server && + git config --add branch.master.remote origin && + git config --add branch.master.merge refs/heads/master && + git fetch && + + git checkout -b stable && + git push origin stable +' + +test_expect_success 'pull does a rebase' ' + create-branch topic1 && + echo "$test_name" >a.topic1 && + git add a.topic1 && + git commit -m "move topic1" && + + # Move topic1 on the server + cd server && + git checkout topic1 && + echo "$test_name" >a && + git commit -a -m "move topic1 on the server" && + cd .. && + + # Only one parent + pull && + git cat-file commit $(git rev-parse HEAD) | grep parent | wc -l | grep 1 +' + +#test_expect_success 'pull does a rebase but does not fuck up merges' ' +# # Change "a" itself so we will eventually conflict +# create-branch topic2 && +# echo "$test_name on topic2" >a && +# git commit -a -m "move topic2" && +# +# # Change a.topic2 as well for another commit to continue rebasing after fixing the conflict +# echo "$test_name on topic2" >a.topic2 && +# git add a.topic2 && +# git commit -m "move a.topic2" && +# +# # Move stable +# git checkout stable && +# echo "$test_name on stable" >a && +# git commit -a -m "move stable" && +# git push origin stable && +# +# # Move topic2 on the server, then merge stable +# cd server && +# git checkout stable && +# echo "$test_name on stable server" >a.stable.server && +# git add a.stable.server && +# git commit -m "move stable server" && +# git checkout topic2 && +# echo "$test_name" >a.topic2.server && +# git add a.topic2.server && +# git commit -m "move topic2 on the server" && +# git merge stable && +# cd .. && +# +# # Merge stable locally too--should conflict +# git checkout topic2 && +# git merge origin/stable +# +# # Now pull and see what happens +# # pull +#' + +test_done + -- 2.39.5