X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-cvsexportcommit.perl;h=5d13a54194d23ceaa50bc52a4f192156898d661a;hb=8ef1c7c77d3e5950a839d9ae348827fa288a9a11;hp=d1051d074bcf685dcc57cae90cca9053dc71a76f;hpb=8c278abcbe35b23e9f93e99daf2144336fad1849;p=git.git diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl index d1051d074..5d13a5419 100755 --- a/git-cvsexportcommit.perl +++ b/git-cvsexportcommit.perl @@ -63,15 +63,15 @@ foreach my $p (@commit) { } if ($parent) { + my $found; # double check that it's a valid parent foreach my $p (@parents) { - my $found; if ($p eq $parent) { $found = 1; last; }; # found it - die "Did not find $parent in the parents for this commit!"; } + die "Did not find $parent in the parents for this commit!" if !$found; } else { # we don't have a parent from the cmdline... if (@parents == 1) { # it's safe to get it from the commit $parent = $parents[0]; @@ -179,7 +179,7 @@ my @bfiles = grep(m/^Binary/, safe_pipe_capture('git-diff-tree', '-p', $parent, @bfiles = map { chomp } @bfiles; foreach my $f (@bfiles) { # check that the file in cvs matches the "old" file - # extract the file to $tmpdir and comparre with cmp + # extract the file to $tmpdir and compare with cmp my $tree = safe_pipe_capture('git-rev-parse', "$parent^{tree}"); chomp $tree; my $blob = `git-ls-tree $tree "$f" | cut -f 1 | cut -d ' ' -f 3`; @@ -273,7 +273,7 @@ sub cleanupcvs { } } -# An alterative to `command` that allows input to be passed as an array +# An alternative to `command` that allows input to be passed as an array # to work around shell problems with weird characters in arguments # if the exec returns non-zero we die sub safe_pipe_capture {