Use README.md in setup.py long_description
[stgit.git] / t / t5000-refresh-submodules.sh
blob463c16434de2a330c084b79a2dad0856977aede6
1 #!/bin/sh
3 # Copyright (c) 2017 Intel Corporation
6 test_description='Refresh with submodules'
8 . ./test-lib.sh
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" &&
14 stg init &&
16 cd submodules/foo &&
17 touch file1 &&
18 git add file1 &&
19 git commit -m "change in submodule"
23 test_expect_success 'refresh with a submodule does not include by default' '
24 stg new -m p1 &&
25 stg refresh &&
26 [ "$(stg status)" = " M submodules/foo" ]
29 test_expect_success 'refresh includes non-submodule changes' '
30 mkdir dir2 &&
31 touch dir2/file2 &&
32 git add dir2/file2 &&
34 cd dir2 &&
35 stg refresh &&
36 [ "$(stg status)" = " M ../submodules/foo" ]
37 ) &&
38 [ "$(stg status)" = " M submodules/foo" ]
41 test_expect_success 'refresh with --submodules' '
43 cd dir2 &&
44 stg refresh --submodules
45 ) &&
46 [ "$(stg status)" = "" ]
49 test_expect_success 'refresh --no-submodules overrides config' '
50 stg undo &&
51 stg undo &&
52 git config stgit.refreshsubmodules yes &&
53 stg refresh --no-submodules &&
54 [ "$(stg status)" = " M submodules/foo" ]
57 test_expect_success 'refresh with config' '
58 stg refresh &&
59 [ "$(stg status)" = "" ]
62 test_done