Module git

Source

Structs§

GitConfig

Functions§

get_closest_merge_commit
Searches for the nearest merge commit in the repository that also exists upstream.
get_git_modified_files
Returns the files that have been modified in the current branch compared to the master branch. The extensions parameter can be used to filter the files by their extension. Does not include removed files. If extensions is empty, all files will be returned.
get_git_untracked_files
Returns the files that haven’t been added to git yet.
get_rust_lang_rust_remote
Finds the remote for rust-lang/rust. For example for these remotes it will return upstream.
git_upstream_merge_base 🔒
Finds the nearest merge commit by comparing the local HEAD with the upstream branch’s state. To work correctly, the upstream remote must be properly configured using git remote add <name> <url>. In most cases get_closest_merge_commit is the function you are looking for as it doesn’t require remote to be configured.
output_result
Runs a command and returns the output
rev_exists
updated_master_branch
Returns the master branch from which we can take diffs to see changes. This will usually be rust-lang/rust master, but sometimes this might not exist. This could be because the user is updating their forked master branch using the GitHub UI and therefore doesn’t need an upstream master branch checked out. We will then fall back to origin/master in the hope that at least this exists.