File: t5000-refresh-submodules.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 (50 lines) | stat: -rwxr-xr-x 1,045 bytes parent folder | download | duplicates (3)
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
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
#
# Copyright (c) 2017 Intel Corporation
#

test_description='Refresh with submodules'

. ./test-lib.sh

test_expect_success 'refresh with a submodule does not include by default' '
  test_create_repo foo &&
  git submodule add ./foo foo &&
  git commit -m "submodule" &&
  stg init &&
  (
    cd foo &&
    touch file1 &&
    git add file1 &&
    git commit -m "change in submodule"
  ) &&
  stg new p1 -m p1 &&
  stg refresh &&
  [ "$(stg status)" = " M foo" ]
'

test_expect_success 'refresh includes non-submodule changes' '
  touch file2 &&
  git add file2 &&
  stg refresh &&
  [ "$(stg status)" = " M foo" ]
'

test_expect_success 'refresh with --submodules' '
  stg refresh --submodules &&
  [ "$(stg status)" = "" ]
'

test_expect_success 'refresh --no-submodules overrides config' '
  stg undo && stg undo &&
  git config stgit.refreshsubmodules yes &&
  stg refresh --no-submodules &&
  [ "$(stg status)" = " M foo" ]
'

test_expect_success 'refresh with config' '
   stg refresh &&
   [ "$(stg status)" = "" ]
'

test_done