Function | git_version | Attempt to determine the version of git currently installed. |
Function | require_git_version | Require git version >= version, or skip the calling test. |
Function | run_git | Run a git command. |
Function | run_git_or_fail | Run a git command, capture stdout/stderr, and fail if git fails. |
Function | import_repo_to_dir | Import a repo from a fast-export file in a temporary directory. |
Function | check_for_daemon | Check for a running TCP daemon. |
Class | CompatTestCase | Test case that requires git for compatibility checks. |
Function | remove_ro | Undocumented |
Parameters | git_path | Path to the git executable; defaults to the version in the system path. |
Returns | A tuple of ints of the form (major, minor, point, sub-point), or None if no git installation was found. |
Parameters | required_version | A tuple of ints of the form (major, minor, point, sub-point); ommitted components default to 0. |
git_path | Path to the git executable; defaults to the version in the system path. | |
Raises | ValueError | if the required version tuple has too many parts. |
SkipTest | if no suitable git version was found at the given path. |
Run a git command.
Input is piped from the input parameter and output is sent to the standard streams, unless capture_stdout is set.
Parameters | args | A list of args to the git command. |
git_path | Path to to the git executable. | |
input | Input data to be sent to stdin. | |
capture_stdout | Whether to capture and return stdout. | |
popen_kwargs | Additional kwargs for subprocess.Popen; stdin/stdout args are ignored. | |
Returns | A tuple of (returncode, stdout contents). If capture_stdout is False, None will be returned as stdout contents. | |
Raises | OSError | if the git executable was not found. |
Import a repo from a fast-export file in a temporary directory.
These are used rather than binary repos for compat tests because they are more compact and human-editable, and we already depend on git.
Parameters | name | The name of the repository export file, relative to dulwich/tests/data/repos. |
Returns | The path to the imported repository. |
Check for a running TCP daemon.
Defaults to checking 10 times with a delay of 0.1 sec between tries.
Parameters | limit | Number of attempts before deciding no daemon is running. |
delay | Delay between connection attempts. | |
timeout | Socket timeout for connection attempts. | |
port | Port on which we expect the daemon to appear. | |
Returns | A boolean, true if a daemon is running on the specified port, false if not. |