git tag before-rebase &&
git pull --rebase . copy &&
test_cmp_rev HEAD^ copy &&
- test new = "$(git show HEAD:file2)"
+ echo new >expect &&
+ git show HEAD:file2 >actual &&
+ test_cmp expect actual
'
test_expect_success '--rebase fast forward' '
test_must_fail git pull --rebase . copy master 2>err &&
test_cmp_rev HEAD before-rebase &&
test_i18ngrep "Cannot rebase onto multiple branches" err &&
- test modified = "$(git show HEAD:file)"
+ echo modified >expect &&
+ git show HEAD:file >actual &&
+ test_cmp expect actual
'
test_expect_success 'pull --rebase succeeds with dirty working directory and rebase.autostash set' '
test_config pull.rebase true &&
git pull . copy &&
test_cmp_rev HEAD^ copy &&
- test new = "$(git show HEAD:file2)"
+ echo new >expect &&
+ git show HEAD:file2 >actual &&
+ test_cmp expect actual
'
test_expect_success 'pull --autostash & pull.rebase=true' '
test_config branch.to-rebase.rebase true &&
git pull . copy &&
test_cmp_rev HEAD^ copy &&
- test new = "$(git show HEAD:file2)"
+ echo new >expect &&
+ git show HEAD:file2 >actual &&
+ test_cmp expect actual
'
test_expect_success 'branch.to-rebase.rebase should override pull.rebase' '
test_config branch.to-rebase.rebase false &&
git pull . copy &&
test_cmp_rev ! HEAD^ copy &&
- test new = "$(git show HEAD:file2)"
+ echo new >expect &&
+ git show HEAD:file2 >actual &&
+ test_cmp expect actual
'
test_expect_success 'pull --rebase warns on --verify-signatures' '
git reset --hard before-rebase &&
git pull --rebase --verify-signatures . copy 2>err &&
test_cmp_rev HEAD^ copy &&
- test new = "$(git show HEAD:file2)" &&
+ echo new >expect &&
+ git show HEAD:file2 >actual &&
+ test_cmp expect actual &&
test_i18ngrep "ignoring --verify-signatures for rebase" err
'
git reset --hard before-rebase &&
git pull --rebase --no-verify-signatures . copy 2>err &&
test_cmp_rev HEAD^ copy &&
- test new = "$(git show HEAD:file2)" &&
+ echo new >expect &&
+ git show HEAD:file2 >actual &&
+ test_cmp expect actual &&
test_i18ngrep ! "verify-signatures" err
'
git pull . copy &&
test_cmp_rev HEAD^1 before-preserve-rebase &&
test_cmp_rev HEAD^2 copy &&
- test file3 = "$(git show HEAD:file3.t)"
+ echo file3 >expect &&
+ git show HEAD:file3.t >actual &&
+ test_cmp expect actual
'
test_expect_success 'pull.rebase=true flattens keep-merge' '
test_config pull.rebase true &&
git pull . copy &&
test_cmp_rev HEAD^^ copy &&
- test file3 = "$(git show HEAD:file3.t)"
+ echo file3 >expect &&
+ git show HEAD:file3.t >actual &&
+ test_cmp expect actual
'
test_expect_success 'pull.rebase=1 is treated as true and flattens keep-merge' '
test_config pull.rebase 1 &&
git pull . copy &&
test_cmp_rev HEAD^^ copy &&
- test file3 = "$(git show HEAD:file3.t)"
+ echo file3 >expect &&
+ git show HEAD:file3.t >actual &&
+ test_cmp expect actual
'
test_expect_success REBASE_P \
git pull --rebase=false . copy &&
test_cmp_rev HEAD^1 before-preserve-rebase &&
test_cmp_rev HEAD^2 copy &&
- test file3 = "$(git show HEAD:file3.t)"
+ echo file3 >expect &&
+ git show HEAD:file3.t >actual &&
+ test_cmp expect actual
'
test_expect_success '--rebase=true rebases and flattens keep-merge' '
test_config pull.rebase preserve &&
git pull --rebase=true . copy &&
test_cmp_rev HEAD^^ copy &&
- test file3 = "$(git show HEAD:file3.t)"
+ echo file3 >expect &&
+ git show HEAD:file3.t >actual &&
+ test_cmp expect actual
'
test_expect_success REBASE_P \
test_config pull.rebase preserve &&
git pull --rebase . copy &&
test_cmp_rev HEAD^^ copy &&
- test file3 = "$(git show HEAD:file3.t)"
+ echo file3 >expect &&
+ git show HEAD:file3.t >actual &&
+ test_cmp expect actual
'
test_expect_success '--rebase with rebased upstream' '
cd empty_repo2 &&
echo staged-file >staged-file &&
git add staged-file &&
- test "$(git ls-files)" = staged-file &&
+ echo staged-file >expect &&
+ git ls-files >actual &&
+ test_cmp expect actual &&
test_must_fail git pull --rebase .. master 2>err &&
- test "$(git ls-files)" = staged-file &&
- test "$(git show :staged-file)" = staged-file &&
+ echo staged-file >expect &&
+ git ls-files >actual &&
+ test_cmp expect actual &&
+ echo staged-file >expect &&
+ git show :staged-file >actual &&
+ test_cmp expect actual &&
test_i18ngrep "unborn branch with changes added to the index" err
)
'