diff options
author | Stephan Dilly <dilly.stephan@gmail.com> | 2022-01-24 00:36:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-24 00:36:58 +0100 |
commit | 317b245ba016cdb023087579a553773f180b9436 (patch) | |
tree | 7d36602249352a506d4a30f89889a60bec7bf4f2 | |
parent | 9653545c8192e853b30ed52e60b96c70d84d7b4e (diff) |
fix credential.helper config usage inside repo (#1091)
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | asyncgit/src/sync/cred.rs | 5 |
3 files changed, 5 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e387fb6..5c22f064 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - support adding annotations to tags ([#747](https://github.com/extrawurst/gitui/issues/747)) - support inspecting annotation of tag ([#1076](https://github.com/extrawurst/gitui/issues/1076)) - support deleting tag on remote ([#1074](https://github.com/extrawurst/gitui/issues/1074)) +- support git credentials helper (https) ([#800](https://github.com/extrawurst/gitui/issues/800)) ### Fixed - Keep commit message when pre-commit hook fails ([#1035](https://github.com/extrawurst/gitui/issues/1035)) @@ -85,6 +85,7 @@ These are the high level goals before calling out `1.0`: - no support for GPG signing (see [#97](https://github.com/extrawurst/gitui/issues/97)) - no git-lfs support (see [#1089](https://github.com/extrawurst/gitui/discussions/1089)) +- *credential.helper* for https needs to be **explicitly** configured (see [#800](https://github.com/extrawurst/gitui/issues/800) Currently, this tool does not fully substitute the _git shell_, however both tools work well in tandem. diff --git a/asyncgit/src/sync/cred.rs b/asyncgit/src/sync/cred.rs index 57d375ee..4a46c444 100644 --- a/asyncgit/src/sync/cred.rs +++ b/asyncgit/src/sync/cred.rs @@ -4,7 +4,7 @@ use super::{ remotes::get_default_remote_in_repo, repository::repo, RepoPath, }; use crate::error::{Error, Result}; -use git2::{Config, CredentialHelper}; +use git2::CredentialHelper; /// basic Authentication Credentials #[derive(Debug, Clone, Default, PartialEq)] @@ -59,9 +59,10 @@ pub fn extract_username_password( //if the username is in the url we need to set it here, //I dont think `config` will pick it up - if let Ok(config) = Config::open_default() { + if let Ok(config) = repo.config() { helper.config(&config); } + Ok(match helper.execute() { Some((username, password)) => { BasicAuthCredential::new(Some(username), Some(password)) |