GitClient class
Client wrapping external git CLI operations.
Constructors
- GitClient({ProcessRunner runner = const SystemProcessRunner()})
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createTag(
String projectPath, String tagName, {String? message, bool dryRun = false}) → Future< GitOperationResult> -
Creates a local Git tag
tagNamesafely. -
getCommitCount(
String projectPath) → Future< int?> - Gets total commit count on HEAD branch. Returns null if not a git repo or no commits.
-
getCommitRange(
String projectPath, {String? fromTag, String? toCommit, int maxCount = 50}) → Future< GitCommitRange> -
Gets structured GitCommitRange between
fromTag(or previous tag) andtoCommit(default HEAD). -
getCommits(
String projectPath, {String? fromRef, String? toRef, int? maxCount}) → Future< List< GitCommit> > - Fetches a list of structured GitCommit objects.
-
getCurrentBranch(
String projectPath) → Future< String?> -
Gets current checked-out git branch name (e.g.
main). -
getCurrentCommitSha(
String projectPath, {bool short = true}) → Future< String?> - Gets full or short commit SHA of HEAD commit.
-
getPreviousTag(
String projectPath) → Future< String?> - Gets previous tag before current HEAD commit.
-
getTags(
String projectPath) → Future< List< String> > - Gets all tags in the repository.
-
getUncommittedFiles(
String projectPath) → Future< List< String> > - Gets uncommitted file paths.
-
hasCleanWorkingTree(
String projectPath) → Future< bool> - Returns true if working directory has no uncommitted changes.
-
isGitRepository(
String projectPath) → Future< bool> -
Checks if
projectPathis inside a git repository. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
tagExists(
String projectPath, String tagName) → Future< bool> - Checks if a tag exists in the repository.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited