Read-only mirror — the public repositories of the Forgejo instance, refreshed every 10 minutes. The live instance (fg.dieschoenewolke.de) is reachable only over the VPN; clone here with https://git.dieschoenewolke.de/git/<owner>/<repo>.git.
summaryrefslogtreecommitdiff
path: root/src/git-command-manager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/git-command-manager.ts')
-rw-r--r--src/git-command-manager.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts
index 4cbfe4a..a874e35 100644
--- a/src/git-command-manager.ts
+++ b/src/git-command-manager.ts
@@ -33,6 +33,7 @@ export interface IGitCommandManager {
remoteAdd(remoteName: string, remoteUrl: string): Promise<void>
removeEnvironmentVariable(name: string): void
setEnvironmentVariable(name: string, value: string): void
+ setRemoteUrl(url: string): Promise<void>
submoduleForeach(command: string, recursive: boolean): Promise<string>
submoduleSync(recursive: boolean): Promise<void>
submoduleUpdate(fetchDepth: number, recursive: boolean): Promise<void>
@@ -40,7 +41,7 @@ export interface IGitCommandManager {
tryClean(): Promise<boolean>
tryConfigUnset(configKey: string, globalConfig?: boolean): Promise<boolean>
tryDisableAutomaticGarbageCollection(): Promise<boolean>
- tryGetFetchUrl(): Promise<string>
+ tryGetRemoteUrl(): Promise<string>
tryReset(): Promise<boolean>
}
@@ -241,6 +242,10 @@ class GitCommandManager {
this.gitEnv[name] = value
}
+ async setRemoteUrl(value: string): Promise<void> {
+ await this.config('git.remote.url', value)
+ }
+
async submoduleForeach(command: string, recursive: boolean): Promise<string> {
const args = ['submodule', 'foreach']
if (recursive) {
@@ -309,7 +314,7 @@ class GitCommandManager {
return output.exitCode === 0
}
- async tryGetFetchUrl(): Promise<string> {
+ async tryGetRemoteUrl(): Promise<string> {
const output = await this.execGit(
['config', '--local', '--get', 'remote.origin.url'],
true