This module subclasses the Files module for Git repository.
See Files POD for method information.
Methods are sorted in the same order as in the super-class.
Note:
GIT.pm was initially based on library Git.pm module. Unfortunately, it systematically errored out with "Insecure dependency in …" and was unusable.
Since it was inconvenient to chase all occurrences of arguments to untaint them, it was considered easier to rewrite an interface method to git commands and untaint there.
It is likely that it is less versatile and clean than the library module, but at least it works for LXR.
_git_cmd ($cmd, @args)
_git_cmd
returns a handle to a pipe where the command outputs its result.
$cmd
a string containing the Git command
@args
a list containing the command arguments
The command is processed after untainting the arguments.
_git_oneline ($cmd, @args)
_git_oneline
is a wrapper function for _git-cmd
when a single line result is expected.
$cmd
a string containing the Git command
@args
a list containing the command arguments
The function passes its arguments to _git_cmd
and closes the pipe after reading one line. This line is returned as a string.
Note:
Pipe is closed before returning BUT close status is not checked despite all warnings in perldoc. It is expected that the result line will be empty or undefined if something goes wrong with the pipe.