diff: Tests for "git diff -O"

Adapted from $gmane/236427 by Anders Waldenborg, "diff: Add
diff.orderfile configuration variable".

Signed-off-by: Anders Waldenborg <anders@0x63.nu>
Signed-off-by: Samuel Bronson <naesten@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff: Let "git diff -O" read orderfile from any file, failing when appropriate

The -O flag really shouldn't silently fail to do anything when given a
path that it can't read from.

However, it should be able to read from un-mappable files, such as
pipes/fifos, /dev/null (as we document in the next patch), or in
fact *any* empty file (SUSv3 says mmapping length 0 must fail, and
Linux does so since 2.6.12).

Note: "-O/dev/null" did have the right effect, since the existing
error handling essentially worked out to "silently ignore the
orderfile".

So lets toss all of that logic to get the file mmapped and just use
strbuf_read_file() instead, which gives us decent error handling
practically for free.

Signed-off-by: Samuel Bronson <naesten@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff: Add diff.orderfile configuration variable

diff.orderfile acts as a default for the -O command line option.

[sb: split up aw's original patch; reworked tests and docs]

[FIXME: Relative paths should presumably be interpreted relative to
repository root; how should this be accomplished?]

Signed-off-by: Anders Waldenborg <anders@0x63.nu>
Signed-off-by: Samuel Bronson <naesten@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
FIXUP! tests
Merge branch 'sb/diff-orderfile-config' into pu

* sb/diff-orderfile-config:
  FIXUP! tests
  diff: Add diff.orderfile configuration variable
  diff: Let "git diff -O" read orderfile from any file, failing when appropriate
  diff: Tests for "git diff -O"