Release 0.19
[stgit.git] / t / t5000-refresh-submodules.sh
blob7f5cf102f968196f57e2e5623f11de658d0cb606
1 #!/bin/sh
3 # Copyright (c) 2017 Intel Corporation
6 test_description='Refresh with submodules'
8 . ./test-lib.sh
10 test_expect_success 'refresh with a submodule does not include by default' '
11 test_create_repo foo &&
12 git submodule add ./foo foo &&
13 git commit -m "submodule" &&
14 stg init &&
16 cd foo &&
17 touch file1 &&
18 git add file1 &&
19 git commit -m "change in submodule"
20 ) &&
21 stg new p1 -m p1 &&
22 stg refresh &&
23 [ "$(stg status)" = " M foo" ]
26 test_expect_success 'refresh includes non-submodule changes' '
27 touch file2 &&
28 git add file2 &&
29 stg refresh &&
30 [ "$(stg status)" = " M foo" ]
33 test_expect_success 'refresh with --submodules' '
34 stg refresh --submodules &&
35 [ "$(stg status)" = "" ]
38 test_expect_success 'refresh --no-submodules overrides config' '
39 stg undo && stg undo &&
40 git config stgit.refreshsubmodules yes &&
41 stg refresh --no-submodules &&
42 [ "$(stg status)" = " M foo" ]
45 test_expect_success 'refresh with config' '
46 stg refresh &&
47 [ "$(stg status)" = "" ]
50 test_done