mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
style: move declarations of callbacks above the function they will be used in
This commit is contained in:
parent
a1d617e053
commit
5be0d0a6b5
2 changed files with 24 additions and 22 deletions
|
@ -139,18 +139,6 @@ void pop({
|
|||
/// IMPORTANT: make sure to clear that list since it's a global variable.
|
||||
var _stashList = <Stash>[];
|
||||
|
||||
/// Loop over all the stashed states.
|
||||
List<Stash> list(Pointer<git_repository> repo) {
|
||||
const except = -1;
|
||||
git_stash_cb callBack = Pointer.fromFunction(_stashCb, except);
|
||||
libgit2.git_stash_foreach(repo, callBack, nullptr);
|
||||
|
||||
final result = _stashList.toList(growable: false);
|
||||
_stashList.clear();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// A callback function to iterate over all the stashed states.
|
||||
int _stashCb(
|
||||
int index,
|
||||
|
@ -165,3 +153,15 @@ int _stashCb(
|
|||
));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// Loop over all the stashed states.
|
||||
List<Stash> list(Pointer<git_repository> repo) {
|
||||
const except = -1;
|
||||
git_stash_cb callBack = Pointer.fromFunction(_stashCb, except);
|
||||
libgit2.git_stash_foreach(repo, callBack, nullptr);
|
||||
|
||||
final result = _stashList.toList(growable: false);
|
||||
_stashList.clear();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue