Skip to content

Commit 72c7441

Browse files
committed
Restore updateRepositoryPath temporarily
This will be removed once we move to the upstream worktree implementation
1 parent e8824dc commit 72c7441

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

app/src/lib/stores/app-store.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8272,6 +8272,30 @@ export class AppStore extends TypedBaseStore<IAppState> {
82728272
}
82738273
}
82748274

8275+
public async _updateRepositoryPath(
8276+
repository: Repository,
8277+
path: string
8278+
): Promise<void> {
8279+
const rt = await getRepositoryType(path)
8280+
8281+
if (rt.kind === 'regular') {
8282+
await this.repositoriesStore.updateRepositoryPath(
8283+
repository,
8284+
rt.topLevelWorkingDirectory,
8285+
rt.gitDir
8286+
)
8287+
} else if (rt.kind === 'unsafe') {
8288+
await this.repositoriesStore.updateRepositoryPath(
8289+
repository,
8290+
path,
8291+
undefined,
8292+
true
8293+
)
8294+
} else {
8295+
this.emitError(new Error(this.getInvalidRepoPathsMessage([path])))
8296+
}
8297+
}
8298+
82758299
public async _removeRepository(
82768300
repository: Repository | CloningRepository,
82778301
moveToTrash: boolean

app/src/ui/dispatcher/dispatcher.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,6 +1926,14 @@ export class Dispatcher {
19261926
return this.appStore._relocateRepository(repository)
19271927
}
19281928

1929+
/** Update the repository's path. */
1930+
public async updateRepositoryPath(
1931+
repository: Repository,
1932+
path: string
1933+
): Promise<void> {
1934+
await this.appStore._updateRepositoryPath(repository, path)
1935+
}
1936+
19291937
/**
19301938
* Change the workflow preferences for the specified repository.
19311939
*

0 commit comments

Comments
 (0)