3 # Copyright (c) 2017 Intel Corporation
6 test_description
='Refresh with submodules'
10 test_expect_success
'setup submodule' '
11 test_create_repo submodules/foo &&
12 git submodule add ./submodules/foo submodules/foo &&
13 git commit -m "submodule" &&
19 git commit -m "change in submodule"
23 test_expect_success
'refresh with a submodule does not include by default' '
26 [ "$(stg status)" = " M submodules/foo" ]
29 test_expect_success
'refresh includes non-submodule changes' '
36 [ "$(stg status)" = " M ../submodules/foo" ]
38 [ "$(stg status)" = " M submodules/foo" ]
41 test_expect_success
'refresh with --submodules' '
44 stg refresh --submodules
46 [ "$(stg status)" = "" ]
49 test_expect_success
'refresh --no-submodules overrides config' '
52 git config stgit.refreshsubmodules yes &&
53 stg refresh --no-submodules &&
54 [ "$(stg status)" = " M submodules/foo" ]
57 test_expect_success
'refresh with config' '
59 [ "$(stg status)" = "" ]