1#!/bin/sh
   2test_description='checkout should leave clean stat info'
   4. ./test-lib.sh
   6test_expect_success 'setup' '
   8        echo hello >world &&
  10        git update-index --add world &&
  11        git commit -m initial &&
  12        git branch side &&
  13        echo goodbye >world &&
  14        git update-index --add world &&
  15        git commit -m second
  16'
  18test_expect_success 'branch switching' '
  20        git reset --hard &&
  22        test "$(git diff-files --raw)" = "" &&
  23        git checkout master &&
  25        test "$(git diff-files --raw)" = "" &&
  26        git checkout side &&
  28        test "$(git diff-files --raw)" = "" &&
  29        git checkout master &&
  31        test "$(git diff-files --raw)" = ""
  32'
  34test_expect_success 'path checkout' '
  36        git reset --hard &&
  38        test "$(git diff-files --raw)" = "" &&
  39        git checkout master world &&
  41        test "$(git diff-files --raw)" = "" &&
  42        git checkout side world &&
  44        test "$(git diff-files --raw)" = "" &&
  45        git checkout master world &&
  47        test "$(git diff-files --raw)" = ""
  48'
  50test_done
  52