| # Copyright (c) 2019 Denton Liu |
| test_description='Test submodules set-url subcommand |
| This test verifies that the set-url subcommand of git-submodule is working |
| test_expect_success 'submodule config cache setup' ' |
| git submodule add ../submodule && |
| git commit -m "add submodule" |
| test_expect_success 'test submodule set-url' ' |
| # add a commit and move the submodule (change the url) |
| mv submodule newsubmodule && |
| git -C newsubmodule show >expect && |
| test_must_fail git submodule update --remote && |
| git submodule set-url submodule ../newsubmodule && |
| grep -F "url = ../newsubmodule" .gitmodules && |
| git submodule update --remote |
| git -C super/submodule show >actual && |