3 # Copyright (c) 2019 Denton Liu
6 test_description
='Test submodules set-url subcommand
8 This test verifies that the set-url subcommand of git-submodule is working
15 test_expect_success
'setup' '
16 git config --global protocol.file.allow always
19 test_expect_success
'submodule config cache setup' '
32 git submodule add ../submodule &&
33 git commit -m "add submodule"
37 test_expect_success
'test submodule set-url' '
38 # add a commit and move the submodule (change the url)
45 mv submodule newsubmodule &&
47 git -C newsubmodule show >expect &&
50 test_must_fail git submodule update --remote &&
51 git submodule set-url submodule ../newsubmodule &&
52 grep -F "url = ../newsubmodule" .gitmodules &&
53 git submodule update --remote
55 git -C super/submodule show >actual &&
56 test_cmp expect actual