mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-15 07:56:11 +08:00
Handle new version of git_bindings
This changes the way the SSH keys are managed, they are no longer managed by the git_bindings plugin and are instead just passed as parameters. They are now saved in shared_prefs. This allows us to easily have multiple ssh keys. It also allows us to store the ssh keys in a more secure storage location in the future.
This commit is contained in:
@ -171,7 +171,12 @@ class GitNoteRepository {
|
||||
|
||||
Future<void> fetch() async {
|
||||
try {
|
||||
await _gitRepo.fetch("origin");
|
||||
await _gitRepo.fetch(
|
||||
remote: "origin",
|
||||
publicKey: settings.sshPublicKey,
|
||||
privateKey: settings.sshPrivateKey,
|
||||
password: settings.sshPassword,
|
||||
);
|
||||
} on GitException catch (ex, stackTrace) {
|
||||
Log.e("GitPull Failed", ex: ex, stacktrace: stackTrace);
|
||||
}
|
||||
@ -210,7 +215,12 @@ class GitNoteRepository {
|
||||
} catch (_) {}
|
||||
|
||||
try {
|
||||
await _gitRepo.push("origin");
|
||||
await _gitRepo.push(
|
||||
remote: "origin",
|
||||
publicKey: settings.sshPublicKey,
|
||||
privateKey: settings.sshPrivateKey,
|
||||
password: settings.sshPassword,
|
||||
);
|
||||
} on GitException catch (ex, stackTrace) {
|
||||
if (ex.cause == 'cannot push non-fastforwardable reference') {
|
||||
await fetch();
|
||||
|
Reference in New Issue
Block a user