File: t1005-branch-delete.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 (38 lines) | stat: -rwxr-xr-x 881 bytes parent folder | download | duplicates (8)
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
36
37
38
#!/bin/sh

test_description='Attempt to delete branches'

. ./test-lib.sh

stg init

test_expect_success 'Create a branch (and switch to it)' '
    stg branch --create foo
    '

test_expect_success 'Delete a branch' '
    stg branch --delete master
    '

test_expect_success 'Create a non-StGIT branch and delete it' '
    git branch bar &&
    stg branch --delete bar
    '

test_expect_success 'Delete a nonexistent branch' '
   stg branch --delete bar
   '

test_expect_success 'Make sure the branch ref was deleted' '
    [ -z "$(git show-ref | grep master | tee /dev/stderr)" ]
    '

test_expect_success 'Make sure the branch config was deleted' '
    [ -z "$(git config -l | grep branch\\.master | tee /dev/stderr)" ]
    '

test_expect_success 'Make sure the branch files were deleted' '
    [ -z "$(find .git -type f | grep master | tee /dev/stderr)" ]
    '

test_done