forked from mirrors/jj
signing: allow disabling by setting backend to "none"
We don't seem to have a way to override the config to disable signing. This patch lets you do that by setting `signing.backend="none"`.
This commit is contained in:
parent
8f603f1a9c
commit
fee706dfea
3 changed files with 6 additions and 2 deletions
|
@ -473,7 +473,8 @@
|
|||
"backend": {
|
||||
"type": "string",
|
||||
"enum": ["gpg", "ssh"],
|
||||
"description": "The backend to use for signing commits"
|
||||
"description": "The backend to use for signing commits. The string `none` disables signing.",
|
||||
"default": "none"
|
||||
},
|
||||
"key": {
|
||||
"type": "string",
|
||||
|
|
|
@ -776,6 +776,8 @@ GnuPG or SSH signing keys.
|
|||
|
||||
To do this you need to configure a signing backend.
|
||||
|
||||
Setting the backend to `"none"` disables signing.
|
||||
|
||||
### GnuPG Signing
|
||||
|
||||
```toml
|
||||
|
|
|
@ -245,7 +245,8 @@ impl UserSettings {
|
|||
// separate from sign_settings as those two are needed in pretty different
|
||||
// places
|
||||
pub fn signing_backend(&self) -> Option<String> {
|
||||
self.config.get_string("signing.backend").ok()
|
||||
let backend = self.config.get_string("signing.backend").ok()?;
|
||||
(backend.as_str() != "none").then_some(backend)
|
||||
}
|
||||
|
||||
pub fn sign_settings(&self) -> SignSettings {
|
||||
|
|
Loading…
Reference in a new issue