On Mon, May 18, 2020 at 1:22 PM Laurent Arnoud <laurent@xxxxxxxxxx> wrote: > The `diff.relative` boolean option set to `true` shows only changes in > the current directory/value specified by the `path` argument of the > `relative` option and shows pathnames relative to the aforementioned > directory. > > Teach --no-relative to override earlier --relative > > Signed-off-by: Laurent Arnoud <laurent@xxxxxxxxxx> > --- > diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh > @@ -86,4 +87,79 @@ do > +check_diff_relative_option () { > + dir=$1 > + shift > + expect=$1 > + shift > + relative_opt=$1 > + shift > + test_expect_success "config diff.relative $relative_opt -p $*" " > + short_blob=$(git rev-parse --short "$blob_file2") && You're using double quotes inside a double-quote context. (Note that I dropped the quotes around $blob_file2 in the example I gave in order to avoid this problem.) > + cat >expected <<-EOF && > + diff --git a/$expect b/$expect > + new file mode 100644 > + index 0000000..\$short_blob > + --- /dev/null > + +++ b/$expect > + @@ -0,0 +1 @@ > + +other content > + EOF > + test_config -C $dir diff.relative $relative_opt && > + git -C '$dir' diff -p $* HEAD^ >actual && > + test_cmp expected actual > + " > +}