t / t3403-rebase-skip.shon commit Merge branch 'maint' (82cc8d8)
   1#!/bin/sh
   2#
   3# Copyright (c) 2006 Eric Wong
   4#
   5
   6test_description='git rebase --merge --skip tests'
   7
   8. ./test-lib.sh
   9
  10# we assume the default git-am -3 --skip strategy is tested independently
  11# and always works :)
  12
  13test_expect_success setup '
  14        echo hello > hello &&
  15        git add hello &&
  16        git commit -m "hello" &&
  17        git branch skip-reference &&
  18
  19        echo world >> hello &&
  20        git commit -a -m "hello world" &&
  21        echo goodbye >> hello &&
  22        git commit -a -m "goodbye" &&
  23
  24        git checkout -f skip-reference &&
  25        echo moo > hello &&
  26        git commit -a -m "we should skip this" &&
  27        echo moo > cow &&
  28        git add cow &&
  29        git commit -m "this should not be skipped" &&
  30        git branch pre-rebase skip-reference &&
  31        git branch skip-merge skip-reference
  32        '
  33
  34test_expect_failure 'rebase with git am -3 (default)' '
  35        git rebase master
  36'
  37
  38test_expect_success 'rebase --skip with am -3' '
  39        git reset --hard HEAD &&
  40        git rebase --skip
  41        '
  42test_expect_success 'checkout skip-merge' 'git checkout -f skip-merge'
  43
  44test_expect_failure 'rebase with --merge' 'git rebase --merge master'
  45
  46test_expect_success 'rebase --skip with --merge' '
  47        git reset --hard HEAD &&
  48        git rebase --skip
  49        '
  50
  51test_expect_success 'merge and reference trees equal' \
  52        'test -z "`git-diff-tree skip-merge skip-reference`"'
  53
  54test_debug 'gitk --all & sleep 1'
  55
  56test_done
  57