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 'submodule config cache setup' '
28 git submodule add ../submodule &&
29 git commit -m "add submodule"
33 test_expect_success 'test submodule set-url' '
34 # add a commit and move the submodule (change the url)
41 mv submodule newsubmodule &&
43 git -C newsubmodule show >expect &&
46 test_must_fail git submodule update --remote &&
47 git submodule set-url submodule ../newsubmodule &&
48 grep -F "url = ../newsubmodule" .gitmodules &&
49 git submodule update --remote
51 git -C super/submodule show >actual &&
52 test_cmp expect actual