]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t3400: demonstrate failure with format.useAutoBase
authorDenton Liu <liu.denton@gmail.com>
Wed, 4 Dec 2019 21:24:50 +0000 (13:24 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Dec 2019 14:06:18 +0000 (06:06 -0800)
Ever since bb52995f3e (format-patch: introduce format.useAutoBase
configuration, 2016-04-26), `git rebase` has been broken when
`format.useAutoBase = true`. It fails when rebasing a branch:

fatal: failed to get upstream, if you want to record base commit automatically,
please use git branch --set-upstream-to to track a remote branch.
Or you could specify base commit by --base=<base-commit-id> manually
error:
git encountered an error while preparing the patches to replay
these revisions:

    ede2467cdedc63784887b587a61c36b7850ebfac..d8f581194799ae29bf5fa72a98cbae98a1198b12

As a result, git cannot rebase them.

Demonstrate that failure here.

Reported-by: Christian Biesinger <cbiesinger@google.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3400-rebase.sh

index ab18ac5f28ac5e2828689d1ca4ca93b0990054c9..ca99e8c6c4392fef1e1e61638cf447cb8a2fa23a 100755 (executable)
@@ -159,6 +159,12 @@ test_expect_success 'fail when upstream arg is missing and not configured' '
        test_must_fail git rebase
 '
 
+test_expect_failure 'rebase works with format.useAutoBase' '
+       test_config format.useAutoBase true &&
+       git checkout topic &&
+       git rebase master
+'
+
 test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg' '
        git checkout -b default-base master &&
        git checkout -b default topic &&