mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-26 00:29:20 +08:00
Use dart-git for most operations in Desktop
libgit2 hasn't been hooked up so far. This way, almost everything but cloning working. Related to #137
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
// @dart=2.9
|
// @dart=2.9
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:io' show Platform;
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
@ -14,7 +15,7 @@ import 'package:gitjournal/error_reporting.dart';
|
|||||||
import 'package:gitjournal/settings.dart';
|
import 'package:gitjournal/settings.dart';
|
||||||
import 'package:gitjournal/utils/logger.dart';
|
import 'package:gitjournal/utils/logger.dart';
|
||||||
|
|
||||||
final bool useDartGit = false;
|
bool useDartGit = false;
|
||||||
|
|
||||||
class NoteRepoResult {
|
class NoteRepoResult {
|
||||||
bool error;
|
bool error;
|
||||||
@ -34,7 +35,12 @@ class GitNoteRepository {
|
|||||||
GitNoteRepository({
|
GitNoteRepository({
|
||||||
@required this.gitDirPath,
|
@required this.gitDirPath,
|
||||||
@required this.settings,
|
@required this.settings,
|
||||||
}) : _gitRepo = GitRepo(folderPath: gitDirPath);
|
}) : _gitRepo = GitRepo(folderPath: gitDirPath) {
|
||||||
|
// git-bindings aren't properly implemented in these platformsk
|
||||||
|
if (Platform.isLinux || Platform.isMacOS || Platform.isWindows) {
|
||||||
|
useDartGit = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> _add(String pathSpec) async {
|
Future<void> _add(String pathSpec) async {
|
||||||
if (useDartGit) {
|
if (useDartGit) {
|
||||||
|
Reference in New Issue
Block a user