t / t4037-diff-r-t-dirs.shon commit doc: promote "git restore" (80f537f)
   1#!/bin/sh
   2
   3test_description='diff -r -t shows directory additions and deletions'
   4
   5. ./test-lib.sh
   6
   7test_expect_success setup '
   8        mkdir dc dr dt &&
   9        >dc/1 &&
  10        >dr/2 &&
  11        >dt/3 &&
  12        >fc &&
  13        >fr &&
  14        >ft &&
  15        git add . &&
  16        test_tick &&
  17        git commit -m initial &&
  18
  19        rm -fr dt dr ft fr &&
  20        mkdir da ft &&
  21        for p in dc/1 da/4 dt ft/5 fc
  22        do
  23                echo hello >$p || exit
  24        done &&
  25        git add -u &&
  26        git add . &&
  27        test_tick &&
  28        git commit -m second
  29'
  30
  31cat >expect <<\EOF
  32A       da
  33A       da/4
  34M       dc
  35M       dc/1
  36D       dr
  37D       dr/2
  38A       dt
  39D       dt
  40D       dt/3
  41M       fc
  42D       fr
  43D       ft
  44A       ft
  45A       ft/5
  46EOF
  47
  48test_expect_success verify '
  49        git diff-tree -r -t --name-status HEAD^ HEAD >actual &&
  50        test_cmp expect actual
  51'
  52
  53test_done