Subject: | Tests fail with git config "diff.noprefix = true" |
Hey,
I tried installing Git::Repository::Plugin::Log this morning and t/40-plugin-log.t failed because I have the diff.noprefix option enabled in my ~/.gitconfig file.
# got: 'diff --git file file
# new file mode 100644
# index 0000000..e69de29
# '
# expected: 'diff --git a/file b/file
# new file mode 100644
# index 0000000..e69de29
# '
Assuming you are calling git from the command-line, you could pass '-c diff.noprefix=false' as a parameter to ensure consistent output.
alex@yuzu:~/example$ git diff | head -n 1
diff --git weaver.ini weaver.ini
alex@yuzu:~/example$ git -c 'diff.noprefix=false' diff | head -n 1
diff --git a/weaver.ini b/weaver.ini
Sorry for not sending a patch. I only came across this on my way to patch another CPAN module :-)
- Alex