diff --git a/src/cmd/commit.ts b/src/cmd/commit.ts index 27b17fee4e..b8f9d2babc 100644 --- a/src/cmd/commit.ts +++ b/src/cmd/commit.ts @@ -81,9 +81,12 @@ const commitAndPush = async (gitConfig: GitRepoConfig, initialInstall = false): const filesChangedCount = statusOutput.split('\n').length - 1 if (filesChangedCount === 0) { d.log('Nothing to commit') - return + if (!initialInstall) { + return + } + } else { + await $git`git commit -m ${message} --no-verify`.quiet() } - await $git`git commit -m ${message} --no-verify`.quiet() } catch (e) { const errorMsg = `commitAndPush error: ${e?.message?.replace(password, '****')}` d.error(errorMsg) diff --git a/src/common/git-config.ts b/src/common/git-config.ts index a6733dccf5..acc3c3e94f 100644 --- a/src/common/git-config.ts +++ b/src/common/git-config.ts @@ -86,10 +86,10 @@ export function getAuthUrlFromGitConfig(credentials: Partial): st } const url = new URL(repoUrl) if (username) { - url.username = username - url.password = password + url.username = encodeURIComponent(username) + url.password = encodeURIComponent(password) } else { - url.username = password + url.username = encodeURIComponent(password) url.password = '' } return url.toString()