diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-01-06 08:42:11 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-06 08:42:11 +0100 |
commit | 902f2f4f0a0bcc6c8d63ad4cd6b75b7eb9d65a72 (patch) | |
tree | d47607e6111ba79292a3e5dcc69603139d7e0623 /t | |
parent | Merge branch 'jk/pathspec-literal' (diff) | |
parent | submodule add: If --branch is given, record it in .gitmodules (diff) | |
download | git-902f2f4f0a0bcc6c8d63ad4cd6b75b7eb9d65a72.tar.xz git-902f2f4f0a0bcc6c8d63ad4cd6b75b7eb9d65a72.zip |
Merge branch 'wk/submodule-update-remote'
The beginning of 'integrate with the tip of the remote branch, not
the commit recorded in the superproject gitlink' support.
* wk/submodule-update-remote:
submodule add: If --branch is given, record it in .gitmodules
submodule update: add --remote for submodule's upstream changes
submodule: add get_submodule_config helper funtion
Diffstat (limited to 't')
-rwxr-xr-x | t/t7400-submodule-basic.sh | 1 | ||||
-rwxr-xr-x | t/t7406-submodule-update.sh | 31 |
2 files changed, 32 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index de7d45352e..2683cba7e3 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -133,6 +133,7 @@ test_expect_success 'submodule add --branch' ' ( cd addtest && git submodule add -b initial "$submodurl" submod-branch && + test "initial" = "$(git config -f .gitmodules submodule.submod-branch.branch)" && git submodule init ) && diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index feaec6cdf4..4975ec07ce 100755 --- a/t/t7406-submodule-update.sh +++ b/t/t7406-submodule-update.sh @@ -135,6 +135,37 @@ test_expect_success 'submodule update --force forcibly checks out submodules' ' ) ' +test_expect_success 'submodule update --remote should fetch upstream changes' ' + (cd submodule && + echo line4 >> file && + git add file && + test_tick && + git commit -m "upstream line4" + ) && + (cd super && + git submodule update --remote --force submodule && + cd submodule && + test "$(git log -1 --oneline)" = "$(GIT_DIR=../../submodule/.git git log -1 --oneline)" + ) +' + +test_expect_success 'local config should override .gitmodules branch' ' + (cd submodule && + git checkout -b test-branch && + echo line5 >> file && + git add file && + test_tick && + git commit -m "upstream line5" && + git checkout master + ) && + (cd super && + git config submodule.submodule.branch test-branch && + git submodule update --remote --force submodule && + cd submodule && + test "$(git log -1 --oneline)" = "$(GIT_DIR=../../submodule/.git git log -1 --oneline test-branch)" + ) +' + test_expect_success 'submodule update --rebase staying on master' ' (cd super/submodule && git checkout master |