Help language development. Donate to The Perl Foundation
Git::Status - obtain status of a git repository
use Git::Status; my $status := Git::Status.new(:$directory); if $status.added -> @added { say "Added:"; .say for @added; } if $status.deleted -> @deleted { say "Deleted:"; .say for @deleted; } if $status.modified -> @modified { say "Modified:"; .say for @modified; } if $status.untracked -> @untracked { say "Untracked:"; .say for @untracked; }
Git::Status provides a simple way to obtain the status if a git repository.
The directory of the git repository. Can be specified as either an IO::Path
object, or as a string. Defaults to $*CWD
. It should be readable.
The paths of files that have been added.
The paths of files that have been deleted.
The directory of the repository, as an IO::Path
object.
A text representation of the object, empty string if there were no added, deleted or modified files.
The paths of files that have been modified.
The paths of files that are not tracked yet.
Elizabeth Mattijsen [email protected]
Source can be located at: https://github.com/lizmat/Git-Status . Comments and Pull Requests are welcome.
Copyright 2021 Elizabeth Mattijsen
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.