summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-06-04 21:39:48 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-06-04 21:39:48 +0900
commitf635b8d17b673ffb96c0f10d11751500e1892b2a (patch)
tree41d2a0f42dfa5a060d96a12194efc49ced331633 /t
parentA bit more topics before -rc1 (diff)
parentsubmodule: do not pass null OID to setup_revisions (diff)
downloadtgif-f635b8d17b673ffb96c0f10d11751500e1892b2a.tar.xz
Merge branch 'jt/submodule-pull-recurse-rebase'
"git pull -recurse-submodules --rebase", when the submodule repository's history did not have anything common between ours and the upstream's, failed to execute. We need to fetch from them to continue even in such a case. * jt/submodule-pull-recurse-rebase: submodule: do not pass null OID to setup_revisions
Diffstat (limited to 't')
-rwxr-xr-xt/t5572-pull-submodule.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t5572-pull-submodule.sh b/t/t5572-pull-submodule.sh
index 321bd37deb..f916729a12 100755
--- a/t/t5572-pull-submodule.sh
+++ b/t/t5572-pull-submodule.sh
@@ -132,4 +132,25 @@ test_expect_success 'pull rebase recursing fails with conflicts' '
test_i18ngrep "locally recorded submodule modifications" err
'
+test_expect_success 'branch has no merge base with remote-tracking counterpart' '
+ rm -rf parent child &&
+
+ test_create_repo a-submodule &&
+ test_commit -C a-submodule foo &&
+
+ test_create_repo parent &&
+ git -C parent submodule add "$(pwd)/a-submodule" &&
+ git -C parent commit -m foo &&
+
+ git clone parent child &&
+
+ # Reset master so that it has no merge base with
+ # refs/remotes/origin/master.
+ OTHER=$(git -C child commit-tree -m bar \
+ $(git -C child rev-parse HEAD^{tree})) &&
+ git -C child reset --hard "$OTHER" &&
+
+ git -C child pull --recurse-submodules --rebase
+'
+
test_done