summaryrefslogtreecommitdiff
path: root/t/t5520-pull.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t5520-pull.sh')
-rwxr-xr-xt/t5520-pull.sh27
1 files changed, 21 insertions, 6 deletions
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 602d996..2f86fca 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -277,14 +277,27 @@ test_expect_success '--rebase' '
test_cmp expect actual
'
-test_expect_success '--rebase fast forward' '
+test_expect_success '--rebase (merge) fast forward' '
git reset --hard before-rebase &&
git checkout -b ff &&
echo another modification >file &&
git commit -m third file &&
git checkout to-rebase &&
- git pull --rebase . ff &&
+ git -c rebase.backend=merge pull --rebase . ff &&
+ test_cmp_rev HEAD ff &&
+
+ # The above only validates the result. Did we actually bypass rebase?
+ git reflog -1 >reflog.actual &&
+ sed "s/^[0-9a-f][0-9a-f]*/OBJID/" reflog.actual >reflog.fuzzy &&
+ echo "OBJID HEAD@{0}: pull --rebase . ff: Fast-forward" >reflog.expected &&
+ test_cmp reflog.expected reflog.fuzzy
+'
+
+test_expect_success '--rebase (am) fast forward' '
+ git reset --hard before-rebase &&
+
+ git -c rebase.backend=apply pull --rebase . ff &&
test_cmp_rev HEAD ff &&
# The above only validates the result. Did we actually bypass rebase?
@@ -327,7 +340,7 @@ test_expect_success '--rebase with conflicts shows advice' '
test_tick &&
git commit -m "Create conflict" seq.txt &&
test_must_fail git pull --rebase . seq 2>err >out &&
- test_i18ngrep "Resolve all conflicts manually" out
+ test_i18ngrep "Resolve all conflicts manually" err
'
test_expect_success 'failed --rebase shows advice' '
@@ -341,7 +354,7 @@ test_expect_success 'failed --rebase shows advice' '
git checkout -f -b fails-to-rebase HEAD^ &&
test_commit v2-without-cr file "2" file2-lf &&
test_must_fail git pull --rebase . diverging 2>err >out &&
- test_i18ngrep "Resolve all conflicts manually" out
+ test_i18ngrep "Resolve all conflicts manually" err
'
test_expect_success '--rebase fails with multiple branches' '
@@ -761,8 +774,10 @@ test_expect_success 'git pull --rebase does not reapply old patches' '
(
cd dst &&
test_must_fail git pull --rebase &&
- find .git/rebase-apply -name "000*" >patches &&
- test_line_count = 1 patches
+ cat .git/rebase-merge/done .git/rebase-merge/git-rebase-todo >work &&
+ grep -v -e \# -e ^$ work >patches &&
+ test_line_count = 1 patches &&
+ rm -f work
)
'