rebase: update branch tail after rebasing
[git] / t / t1514-rev-parse-tail.sh
1 #!/bin/sh
2
3 test_description='test <branch>@{upstream} syntax'
4
5 . ./test-lib.sh
6
7 test_expect_success 'setup' '
8         echo one > content &&
9         git add content &&
10         git commit -m one &&
11         git checkout -b test master &&
12         echo two > new &&
13         git add new &&
14         git commit -a -m two
15 '
16
17 test_expect_success 'test tail creation' '
18         git rev-parse refs/tails/test > actual &&
19         git rev-parse master > expect &&
20         test_cmp expect actual
21 '
22
23 test_expect_success 'test @{tail}' '
24         git rev-parse test@{tail} > actual &&
25         git rev-parse master > expect &&
26         test_cmp expect actual
27 '
28
29 test_expect_success 'test rebase tail update' '
30         git checkout -b next master &&
31         echo three > content &&
32         git commit -a -m three &&
33         git rebase --onto next test@{tail} test &&
34         git rev-parse test@{tail} > actual &&
35         git rev-parse next > expect &&
36         test_cmp expect actual
37 '
38
39 test_done