mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 09:47:35 +08:00
When adding a remote rm the old remote with the same name
This is a problem when setting up the remote fails.
This commit is contained in:
@ -502,6 +502,11 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
|||||||
String error;
|
String error;
|
||||||
try {
|
try {
|
||||||
var repo = await GitRepository.load(repoPath);
|
var repo = await GitRepository.load(repoPath);
|
||||||
|
var remotes = repo.config.remotes;
|
||||||
|
var i = remotes.indexWhere((r) => r.name == widget.remoteName);
|
||||||
|
if (i != -1) {
|
||||||
|
await repo.removeRemote(widget.remoteName);
|
||||||
|
}
|
||||||
await repo.addRemote(widget.remoteName, _gitCloneUrl);
|
await repo.addRemote(widget.remoteName, _gitCloneUrl);
|
||||||
|
|
||||||
var repoN = git_bindings.GitRepo(folderPath: repoPath);
|
var repoN = git_bindings.GitRepo(folderPath: repoPath);
|
||||||
|
@ -181,10 +181,10 @@ packages:
|
|||||||
description:
|
description:
|
||||||
path: "."
|
path: "."
|
||||||
ref: HEAD
|
ref: HEAD
|
||||||
resolved-ref: "071cb643a4924a45986920f44c0e2433ee9159ed"
|
resolved-ref: b489bbb315e066b332e438747c1359004ff2b244
|
||||||
url: "https://github.com/GitJournal/dart_git.git"
|
url: "https://github.com/GitJournal/dart-git.git"
|
||||||
source: git
|
source: git
|
||||||
version: "0.0.1"
|
version: "0.0.2"
|
||||||
device_info:
|
device_info:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -1165,5 +1165,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "0.0.9"
|
version: "0.0.9"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.10.0-110 <2.11.0"
|
dart: ">=2.10.1 <2.11.0"
|
||||||
flutter: ">=1.20.0 <2.0.0"
|
flutter: ">=1.20.0 <2.0.0"
|
||||||
|
@ -33,8 +33,8 @@ dependencies:
|
|||||||
#path: /Users/vishesh/src/gitjournal/git_bindings
|
#path: /Users/vishesh/src/gitjournal/git_bindings
|
||||||
git: https://github.com/GitJournal/git_bindings.git
|
git: https://github.com/GitJournal/git_bindings.git
|
||||||
dart_git:
|
dart_git:
|
||||||
git: https://github.com/GitJournal/dart_git.git
|
git: https://github.com/GitJournal/dart-git.git
|
||||||
#path: /Users/vishesh/src/gitjournal/dart_git
|
#path: /Users/vishesh/src/gitjournal/dart-git
|
||||||
yaml_serializer: ^0.0.9
|
yaml_serializer: ^0.0.9
|
||||||
connectivity: ^0.4.6+1
|
connectivity: ^0.4.6+1
|
||||||
flutter_emoji: ">= 2.0.0"
|
flutter_emoji: ">= 2.0.0"
|
||||||
|
Reference in New Issue
Block a user