File: t3000-dirty-merge.sh

package info (click to toggle)
stgit 0.19-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,748 kB
  • sloc: python: 10,558; sh: 5,739; lisp: 2,678; makefile: 142; perl: 42
file content (35 lines) | stat: -rwxr-xr-x 871 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh

test_description='Try a push that requires merging a file that is dirty'

. ./test-lib.sh

test_expect_success 'Initialize StGit stack with two patches' '
    stg init &&
    touch a &&
    stg add a &&
    git commit -m a &&
    echo 1 > a &&
    git commit -a -m p1 &&
    echo 2 > a &&
    git commit -a -m p2 &&
    stg uncommit -n 2
'

test_expect_success 'Pop one patch and update the other' '
    stg goto p1 &&
    echo 3 > a &&
    stg refresh
'

test_expect_success 'Push with dirty worktree' '
    echo 4 > a &&
    [ "$(echo $(stg series --applied --noprefix))" = "p1" ] &&
    [ "$(echo $(stg series --unapplied --noprefix))" = "p2" ] &&
    conflict stg goto --keep p2 &&
    [ "$(echo $(stg series --applied --noprefix))" = "p1" ] &&
    [ "$(echo $(stg series --unapplied --noprefix))" = "p2" ] &&
    [ "$(echo $(cat a))" = "4" ]
'

test_done