MCPcopy Create free account
hub / github.com/PurpleBooth/git-mit / Vcs

Interface Vcs

mit-commit-message-lints/src/external/vcs.rs:7–41  ·  view source on GitHub ↗

A wrapper around accessing different values from a VCS config

Source from the content-addressed store, hash-verified

5
6/// A wrapper around accessing different values from a VCS config
7pub trait Vcs {
8 /// # Errors
9 ///
10 /// If we can't read the config entries
11 fn entries(&self, glob: Option<&str>) -> Result<Vec<String>>;
12 /// # Errors
13 ///
14 /// If we can't read the config, or it's not parsable into a bool
15 fn get_bool(&self, name: &str) -> Result<Option<bool>>;
16 /// # Errors
17 ///
18 /// If we can't read the config, or it's not parsable into a &str
19 fn get_str(&self, name: &str) -> Result<Option<&str>>;
20 /// # Errors
21 ///
22 /// If we can't read the config, or it's not parsable into an i64
23 fn get_i64(&self, name: &str) -> Result<Option<i64>>;
24 /// # Errors
25 ///
26 /// If the config fails to write
27 fn set_str(&mut self, name: &str, value: &str) -> Result<()>;
28 /// # Errors
29 ///
30 /// If the config fails to write
31 fn set_i64(&mut self, name: &str, value: i64) -> Result<()>;
32 /// # Errors
33 ///
34 /// If the config fails to write
35 fn remove(&mut self, name: &str) -> Result<()>;
36
37 /// The state of the repository currently
38 ///
39 /// None if there is no repository, and we only have config
40 fn state(&self) -> Option<RepoState>;
41}
42
43/// State of the repository
44#[derive(Debug, Copy, Clone)]

Callers

nothing calls this directly

Implementers 4

set_config_authors.rsmit-commit-message-lints/src/mit/cmd/s
set_commit_authors.rsmit-commit-message-lints/src/mit/cmd/s
git2.rsmit-commit-message-lints/src/external/
in_memory.rsmit-commit-message-lints/src/external/

Calls

no outgoing calls

Tested by

no test coverage detected