git-colabor 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -1050,7 +1050,11 @@ async function applyResolvedIdentity(args) {
1050
1050
  await captureBackupIfFirstTouch(opts.cwd);
1051
1051
  await setConfig("user.name", name, "local", opts.cwd);
1052
1052
  await setConfig("user.email", email, "local", opts.cwd);
1053
- if (sshCommand) await setConfig("core.sshCommand", sshCommand, "local", opts.cwd);
1053
+ if (sshCommand) {
1054
+ await setConfig("core.sshCommand", sshCommand, "local", opts.cwd);
1055
+ } else if (identity && !identity.sshKeyPath) {
1056
+ await unsetConfig("core.sshCommand", "local", opts.cwd);
1057
+ }
1054
1058
  await setConfig("colabor.managed", "true", "local", opts.cwd);
1055
1059
  await setConfig("colabor.managed-by", opts.source, "local", opts.cwd);
1056
1060
  const state = await readState(opts.cwd);
@@ -1065,6 +1069,12 @@ async function applyResolvedIdentity(args) {
1065
1069
  if (opts.askpassScriptPath) {
1066
1070
  await setConfig("gpg.ssh.program", await ensureSignWrapper(opts.askpassScriptPath), "local", opts.cwd);
1067
1071
  }
1072
+ } else if (state.signing === true && identity && !identity.sshKeyPath) {
1073
+ state.signing = false;
1074
+ await unsetConfig("commit.gpgsign", "local", opts.cwd);
1075
+ await unsetConfig("gpg.format", "local", opts.cwd);
1076
+ await unsetConfig("user.signingKey", "local", opts.cwd);
1077
+ await unsetConfig("gpg.ssh.program", "local", opts.cwd);
1068
1078
  }
1069
1079
  await writeState(state, opts.cwd);
1070
1080
  let agent;
package/dist/index.cjs CHANGED
@@ -929,7 +929,11 @@ async function applyResolvedIdentity(args) {
929
929
  await captureBackupIfFirstTouch(opts.cwd);
930
930
  await setConfig("user.name", name, "local", opts.cwd);
931
931
  await setConfig("user.email", email, "local", opts.cwd);
932
- if (sshCommand) await setConfig("core.sshCommand", sshCommand, "local", opts.cwd);
932
+ if (sshCommand) {
933
+ await setConfig("core.sshCommand", sshCommand, "local", opts.cwd);
934
+ } else if (identity && !identity.sshKeyPath) {
935
+ await unsetConfig("core.sshCommand", "local", opts.cwd);
936
+ }
933
937
  await setConfig("colabor.managed", "true", "local", opts.cwd);
934
938
  await setConfig("colabor.managed-by", opts.source, "local", opts.cwd);
935
939
  const state = await readState(opts.cwd);
@@ -944,6 +948,12 @@ async function applyResolvedIdentity(args) {
944
948
  if (opts.askpassScriptPath) {
945
949
  await setConfig("gpg.ssh.program", await ensureSignWrapper(opts.askpassScriptPath), "local", opts.cwd);
946
950
  }
951
+ } else if (state.signing === true && identity && !identity.sshKeyPath) {
952
+ state.signing = false;
953
+ await unsetConfig("commit.gpgsign", "local", opts.cwd);
954
+ await unsetConfig("gpg.format", "local", opts.cwd);
955
+ await unsetConfig("user.signingKey", "local", opts.cwd);
956
+ await unsetConfig("gpg.ssh.program", "local", opts.cwd);
947
957
  }
948
958
  await writeState(state, opts.cwd);
949
959
  let agent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-colabor",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Git co-author + multi-identity + SSH key management CLI",
5
5
  "repository": {
6
6
  "type": "git",