git: Put -- before the filename when calling git rev-list to avoid warning message when the file doesn't exist.

master
Joey Hess 2008-05-02 13:03:42 -04:00
parent b2dea99417
commit f06267fc3b
2 changed files with 4 additions and 1 deletions

View File

@ -279,7 +279,8 @@ sub git_sha1 (;$) { #{{{
my $file = shift || q{--}; my $file = shift || q{--};
# Ignore error since a non-existing file might be given. # Ignore error since a non-existing file might be given.
my ($sha1) = run_or_non('git', 'rev-list', '--max-count=1', 'HEAD', $file); my ($sha1) = run_or_non('git', 'rev-list', '--max-count=1', 'HEAD',
'--', $file);
if ($sha1) { if ($sha1) {
($sha1) = $sha1 =~ m/($sha1_pattern)/; # sha1 is untainted now ($sha1) = $sha1 =~ m/($sha1_pattern)/; # sha1 is untainted now
} else { debug("Empty sha1sum for '$file'.") } } else { debug("Empty sha1sum for '$file'.") }

2
debian/changelog vendored
View File

@ -13,6 +13,8 @@ ikiwiki (2.45) UNRELEASED; urgency=low
* Fix ugly display when editing a page that has vanished. * Fix ugly display when editing a page that has vanished.
* srcfile now has an optional second parameter to avoid it throwing an error * srcfile now has an optional second parameter to avoid it throwing an error
if the source file does not exist. if the source file does not exist.
* git: Put -- before the filename when calling git rev-list to avoid
warning message when the file doesn't exist.
-- Joey Hess <joeyh@debian.org> Sat, 26 Apr 2008 15:09:36 -0400 -- Joey Hess <joeyh@debian.org> Sat, 26 Apr 2008 15:09:36 -0400