3 test_description='update'
8 git rev-parse -q --verify $1 > expected &&
9 git rev-parse -q --verify $2 > actual &&
10 test_cmp expected actual
16 echo "Update branch '$1'" > expected
18 test "$2" != "master" && into=" into $2"
19 echo "Merge branch '$1'${into}" > expected
21 git log -1 --format=%s > actual &&
22 test_cmp expected actual
25 test_expect_success 'setup' '
28 git commit -a -m one &&
30 git commit -a -m two &&
32 git remote add origin remote
35 test_expect_success 'basic update' '
36 test_when_finished "rm -rf test" &&
40 git reset --hard @^ &&
42 check master origin/master
46 test_expect_success 'basic update without upstream' '
47 test_when_finished "rm -rf test" &&
51 git reset --hard @^ &&
52 git branch --unset-upstream &&
54 check master origin/master
58 test_expect_success 'basic update no-ff' '
59 test_when_finished "rm -rf test" &&
63 git reset --hard @^ &&
65 check @^1 origin/master &&
66 check_msg master master
70 test_expect_success 'git update non-fast-forward' '
71 test_when_finished "rm -rf test" &&
75 git checkout -b other master^ &&
79 git checkout -b test -t other &&
80 git reset --hard master &&
81 test_must_fail git update &&
86 test_expect_success 'git update non-fast-forward with merge' '
87 test_when_finished "rm -rf test" &&
91 git checkout -b other master^ &&
95 git checkout -b test -t other &&
96 git reset --hard master &&
104 test_expect_success 'git update non-fast-forward with rebase' '
105 test_when_finished "rm -rf test" &&
109 git checkout -b other master^ &&
113 git checkout -b test -t other &&
114 git reset --hard master &&
115 git update --rebase &&
120 test_expect_success 'git update with argument' '
121 test_when_finished "rm -rf test" &&
125 git checkout -b test &&
126 git reset --hard @^ &&
132 test_expect_success 'git update with remote argument' '
133 test_when_finished "rm -rf test" &&
137 git checkout -b test &&
138 git reset --hard @^ &&
139 git update origin/master &&