]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
git: don't redundantly pass "--" to git_sha1
authorSimon McVittie <smcv@debian.org>
Mon, 9 Jan 2017 13:58:58 +0000 (13:58 +0000)
committerSimon McVittie <smcv@debian.org>
Mon, 9 Jan 2017 13:58:58 +0000 (13:58 +0000)
git_sha1 already puts "--" before its arguments, so

    git_sha1_file($dir, 'doc/index.mdwn')

would have incorrectly invoked

    git rev-list --max-count=1 HEAD -- -- doc/index.mdwn

If there is no file in the wiki named "--", that's harmless, because
it merely names the latest revision in which either "--" or
"doc/index.mdwn" changed. However, it could return incorrect results
if there is somehow a file named "--".

IkiWiki/Plugin/git.pm

index 23b99151e13eefada9187f3c17789f37a9527ee2..2bc2500525591343ebdbfbff53935aeebe766a99 100644 (file)
@@ -578,7 +578,7 @@ sub rcs_find_changes ($) {
 sub git_sha1_file ($$) {
        my $dir=shift;
        my $file=shift;
-       return git_sha1($dir, "--", $file);
+       return git_sha1($dir, $file);
 }
 
 sub git_sha1 ($@) {