#!/bin/sh test_description='diff --relative tests' . ./test-lib.sh test_expect_success 'setup' ' git commit --allow-empty -m empty && echo content >file1 && mkdir subdir && echo other content >subdir/file2 && git add . && git commit -m one ' check_diff() { expect=$1; shift cat >expected <actual && test_cmp expected actual " } check_stat() { expect=$1; shift cat >expected <actual && test_cmp expected actual " } check_raw() { expect=$1; shift cat >expected <actual && test_cmp expected actual " } for type in diff stat raw; do check_$type file2 --relative=subdir/ check_$type file2 --relative=subdir check_$type dir/file2 --relative=sub done test_done