diff --git a/lib/setup/screens.dart b/lib/setup/screens.dart index d155a564..08358f6f 100644 --- a/lib/setup/screens.dart +++ b/lib/setup/screens.dart @@ -502,6 +502,11 @@ class GitHostSetupScreenState extends State { String error; try { 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); var repoN = git_bindings.GitRepo(folderPath: repoPath); diff --git a/pubspec.lock b/pubspec.lock index 88734bf2..066fa037 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -181,10 +181,10 @@ packages: description: path: "." ref: HEAD - resolved-ref: "071cb643a4924a45986920f44c0e2433ee9159ed" - url: "https://github.com/GitJournal/dart_git.git" + resolved-ref: b489bbb315e066b332e438747c1359004ff2b244 + url: "https://github.com/GitJournal/dart-git.git" source: git - version: "0.0.1" + version: "0.0.2" device_info: dependency: "direct main" description: @@ -1165,5 +1165,5 @@ packages: source: hosted version: "0.0.9" sdks: - dart: ">=2.10.0-110 <2.11.0" + dart: ">=2.10.1 <2.11.0" flutter: ">=1.20.0 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 61a1f141..fd80368d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,8 +33,8 @@ dependencies: #path: /Users/vishesh/src/gitjournal/git_bindings git: https://github.com/GitJournal/git_bindings.git dart_git: - git: https://github.com/GitJournal/dart_git.git - #path: /Users/vishesh/src/gitjournal/dart_git + git: https://github.com/GitJournal/dart-git.git + #path: /Users/vishesh/src/gitjournal/dart-git yaml_serializer: ^0.0.9 connectivity: ^0.4.6+1 flutter_emoji: ">= 2.0.0"