mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-15 07:56:11 +08:00
Stop guessing the default branch
Talk to the remote via ssh and ask it which is the default branch. This has only been implemented for Android right now, so this breaks the ios build. Fixes #363
This commit is contained in:
@ -241,6 +241,20 @@ class GitNoteRepository {
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> defaultBranch(String remoteName) async {
|
||||
try {
|
||||
return await _gitRepo.defaultBranch(
|
||||
remote: remoteName,
|
||||
publicKey: settings.sshPublicKey,
|
||||
privateKey: settings.sshPrivateKey,
|
||||
password: settings.sshPassword,
|
||||
);
|
||||
} on GitException catch (ex, stackTrace) {
|
||||
Log.e("GitDefaultBranch Failed", ex: ex, stacktrace: stackTrace);
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
Future<int> numChanges() async {
|
||||
try {
|
||||
var repo = await git.GitRepository.load(gitDirPath);
|
||||
|
Reference in New Issue
Block a user