git_walk/lib.rs
1//! `git-walk` discovers git repositories by walking a file tree.
2//!
3//! In git terminology a "walk" usually means a *revwalk*: traversing the commit
4//! graph. `git-walk` does a different kind of walk: it traverses the
5//! *filesystem* to *discover repositories*, reporting each checkout it finds
6//! together with cheap, read-only git metadata, without ever invoking the
7//! `git` binary.
8//!
9//! This crate is a work in progress: the discovery API is not implemented yet.
10
11/// Returns the version of the `git-walk` crate, as declared in `Cargo.toml`.
12///
13/// # Examples
14///
15/// ```
16/// assert_eq!(git_walk::version(), env!("CARGO_PKG_VERSION"));
17/// ```
18#[must_use]
19pub fn version() -> &'static str {
20 env!("CARGO_PKG_VERSION")
21}
22
23#[cfg(test)]
24mod tests {
25 use super::version;
26
27 #[test]
28 fn version_matches_cargo_metadata() {
29 assert_eq!(version(), env!("CARGO_PKG_VERSION"));
30 }
31}