t / t3403-rebase-skip.shon commit Merge branch 'mw/pathinfo' (72bbc38)
   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
  13if test "$no_python"; then
  14        echo "Skipping: no python => no recursive merge"
  15        test_done
  16        exit 0
  17fi
  18
  19test_expect_success setup '
  20        echo hello > hello &&
  21        git add hello &&
  22        git commit -m "hello" &&
  23        git branch skip-reference &&
  24
  25        echo world >> hello &&
  26        git commit -a -m "hello world" &&
  27        echo goodbye >> hello &&
  28        git commit -a -m "goodbye" &&
  29
  30        git checkout -f skip-reference &&
  31        echo moo > hello &&
  32        git commit -a -m "we should skip this" &&
  33        echo moo > cow &&
  34        git add cow &&
  35        git commit -m "this should not be skipped" &&
  36        git branch pre-rebase skip-reference &&
  37        git branch skip-merge skip-reference
  38        '
  39
  40test_expect_failure 'rebase with git am -3 (default)' '
  41        git rebase master
  42'
  43
  44test_expect_success 'rebase --skip with am -3' '
  45        git reset --hard HEAD &&
  46        git rebase --skip
  47        '
  48test_expect_success 'checkout skip-merge' 'git checkout -f skip-merge'
  49
  50test_expect_failure 'rebase with --merge' 'git rebase --merge master'
  51
  52test_expect_success 'rebase --skip with --merge' '
  53        git reset --hard HEAD &&
  54        git rebase --skip
  55        '
  56
  57test_expect_success 'merge and reference trees equal' \
  58        'test -z "`git-diff-tree skip-merge skip-reference`"'
  59
  60test_debug 'gitk --all & sleep 1'
  61
  62test_done
  63