summaryrefslogtreecommitdiffstats
path: root/vendor/gix-credentials/src/lib.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:41:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:41:41 +0000
commit10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87 (patch)
treebdffd5d80c26cf4a7a518281a204be1ace85b4c1 /vendor/gix-credentials/src/lib.rs
parentReleasing progress-linux version 1.70.0+dfsg1-9~progress7.99u1. (diff)
downloadrustc-10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87.tar.xz
rustc-10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87.zip
Merging upstream version 1.70.0+dfsg2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-credentials/src/lib.rs')
-rw-r--r--vendor/gix-credentials/src/lib.rs43
1 files changed, 43 insertions, 0 deletions
diff --git a/vendor/gix-credentials/src/lib.rs b/vendor/gix-credentials/src/lib.rs
new file mode 100644
index 000000000..dfcb4ced7
--- /dev/null
+++ b/vendor/gix-credentials/src/lib.rs
@@ -0,0 +1,43 @@
+//! Interact with git credentials in various ways and launch helper programs.
+//!
+//! ## Feature Flags
+#![cfg_attr(
+ feature = "document-features",
+ cfg_attr(doc, doc = ::document_features::document_features!())
+)]
+#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
+#![deny(missing_docs, rust_2018_idioms)]
+#![forbid(unsafe_code)]
+
+/// A program/executable implementing the credential helper protocol.
+#[derive(Debug)]
+pub struct Program {
+ /// The kind of program, ready for launch.
+ pub kind: program::Kind,
+ /// If true, stderr is enabled, which is the default.
+ pub stderr: bool,
+ /// `Some(…)` if the process is running.
+ child: Option<std::process::Child>,
+}
+
+///
+pub mod helper;
+
+///
+pub mod program;
+
+///
+pub mod protocol;
+
+/// Call the `git credential` helper program performing the given `action`, which reads all context from the git configuration
+/// and does everything `git` typically does. The `action` should have been created with [`helper::Action::get_for_url()`] to
+/// contain only the URL to kick off the process, or should be created by [`helper::NextAction`].
+///
+/// If more control is required, use the [`Cascade`][helper::Cascade] type.
+#[allow(clippy::result_large_err)]
+pub fn builtin(action: helper::Action) -> protocol::Result {
+ protocol::helper_outcome_to_result(
+ helper::invoke(&mut Program::from_kind(program::Kind::Builtin), &action)?,
+ action,
+ )
+}