1
1
Fork
You've already forked under-version-control
0
Is an IO::Path under version control? https://raku.land/zef:lizmat/under-version-control
  • Raku 100%
Elizabeth Mattijsen 283ab1295a 0.0.4
2026年06月25日 21:17:20 +02:00
.github CI test prior to release 2026年06月25日 21:09:17 +02:00
.META 0.0.4 2026年06月25日 21:17:20 +02:00
doc CI test prior to release 2026年06月25日 21:09:17 +02:00
lib CI test prior to release 2025年01月10日 22:37:06 +01:00
t Initial commmit 2022年07月18日 18:57:44 +02:00
xt CI test prior to release 2025年01月10日 22:37:06 +01:00
.gitignore CI test prior to release 2025年01月10日 22:37:06 +01:00
Changes 0.0.4 2026年06月25日 21:17:20 +02:00
dist.ini CI test prior to release 2025年01月10日 22:37:06 +01:00
LICENSE Initial commmit 2022年07月18日 18:57:44 +02:00
META6.json 0.0.4 2026年06月25日 21:17:20 +02:00
README.md CI test prior to release 2026年06月25日 21:09:17 +02:00
run-tests CI test prior to release 2026年06月25日 21:09:17 +02:00

Actions Status Actions Status Actions Status

NAME

under-version-control - is an IO::Path under version control?

SYNOPSIS

use under-version-control;
say "current directory is under version control"
 if ".".IO.&under-version-control;
say "file 'foo.bar' is under version control"
 if under-version-control "foo.bar".IO;

DESCRIPTION

under::version::control provides a subroutine that returns True if the argument appears to be under version control.

This is currently defined as it having a sibling ".git" directory, or any of its parents having a ".git" directory.

Intended to be used by CLI scripts before they do massive changes on a file system: being under version control provides a bigger chance of reversibility if something went wrong.

SEE ALSO

For more fine-grained control on whether a path is under version control, you can also use the Git::Files distribution for that, or the git related functions in path-utils.

AUTHOR

Elizabeth Mattijsen liz@raku.rocks

Source can be located at: https://codeberg.org/lizmat/under-version-control . Comments and Pull Requests are welcome.

If you like this module, or what I’m doing more generally, committing to a small sponsorship would mean a great deal to me!

COPYRIGHT AND LICENSE

Copyright 2022, 2025, 2026 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.