t / t4043-diff-rename-binary.shon commit Merge branch 'maint' (7980e41)
   1#!/bin/sh
   2#
   3# Copyright (c) 2010 Jakub Narebski, Christian Couder
   4#
   5
   6test_description='Move a binary file'
   7
   8. ./test-lib.sh
   9
  10
  11test_expect_success 'prepare repository' '
  12        git init &&
  13        echo foo > foo &&
  14        echo "barQ" | q_to_nul > bar &&
  15        git add . &&
  16        git commit -m "Initial commit"
  17'
  18
  19test_expect_success 'move the files into a "sub" directory' '
  20        mkdir sub &&
  21        git mv bar foo sub/ &&
  22        git commit -m "Moved to sub/"
  23'
  24
  25cat > expected <<\EOF
  26 bar => sub/bar |  Bin 5 -> 5 bytes
  27 foo => sub/foo |    0
  28 2 files changed, 0 insertions(+), 0 deletions(-)
  29
  30diff --git a/bar b/sub/bar
  31similarity index 100%
  32rename from bar
  33rename to sub/bar
  34diff --git a/foo b/sub/foo
  35similarity index 100%
  36rename from foo
  37rename to sub/foo
  38EOF
  39
  40test_expect_success 'git show -C -C report renames' '
  41        git show -C -C --raw --binary --stat | tail -n 12 > current &&
  42        test_cmp expected current
  43'
  44
  45test_done