Repository navigation
Conversation
Needed to call the git remote command with the verbose option to get name and URL. Since the output of the command has variable whitespace, we needed to parse using regex. Since the git remote get-url command always returns the fetch remote, we filter out all odd indexed lines.
|
I see you're diving right into the thick of things! 😄 👍 |
|
This PR is ready for review. |
shiftkey
left a comment
There was a problem hiding this comment.
Looking good, was able to view and change the remote on my repository. Most of the stuff I've called out is for consistency with the rest of the codebase.
| return this._refreshRepository(repository) | ||
| } | ||
|
|
||
| public _setRemoteURL(repository: Repository, name: string, url: string): Promise<void> { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| return this.statsStore.reportStats() | ||
| } | ||
|
|
||
| /** Changes the URl for the remote that matches the given name */ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| return this.performFailableOperation(() => merge(this.repository, branch)) | ||
| } | ||
|
|
||
| /** Changes the URl for the remote that matches the given name */ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| const remotes = lines | ||
| .map(x => x.split(/\s+/)) | ||
| .map(x => ({ name: x[0], url: x[1] })) | ||
| .filter((x, i) => i % 2 !== 0) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| @@ -0,0 +1,4 @@ | |||
| export interface IRemote { | |||
| readonly name: string | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| interface IRepositorySettingsProps { | ||
| readonly dispatcher: Dispatcher | ||
|
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| interface IRemoteProps { | ||
| readonly dispatcher: Dispatcher | ||
|
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| await git([ 'remote', 'add', name, url ], path, 'addRemote') | ||
| } | ||
|
|
||
| /** Changes the URl for the remote that matches the given name */ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| /** The name of the remote. */ | ||
| readonly remoteName: string | null | ||
| /** The remote. */ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| public render() { | ||
| const remote = this.props.remote | ||
| if (!remote) { | ||
| return <div>Nope</div> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Made all requested changes 🥇 |
This PR fixes number 1 in issue #663.
Adds new Repository Settings menu item and functionality to allow remote URL to be updated.
Current State of UI
Menu Item
Remote Settings