mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 12:49:08 -04:00
refactor: remove unnecessary local variables
This commit is contained in:
parent
cfa5268af2
commit
20ca75639d
48 changed files with 446 additions and 237 deletions
|
@ -52,15 +52,14 @@ class Branch {
|
|||
name: name,
|
||||
),
|
||||
);
|
||||
late final GitBranch type;
|
||||
ref.isBranch ? type = GitBranch.local : GitBranch.remote;
|
||||
ref.free();
|
||||
|
||||
_branchPointer = bindings.lookup(
|
||||
repoPointer: repo.pointer,
|
||||
branchName: name,
|
||||
branchType: type.value,
|
||||
branchType: ref.isBranch ? GitBranch.local.value : GitBranch.remote.value,
|
||||
);
|
||||
|
||||
ref.free();
|
||||
}
|
||||
|
||||
late final Pointer<git_reference> _branchPointer;
|
||||
|
@ -93,6 +92,7 @@ class Branch {
|
|||
static void delete({required Repository repo, required String name}) {
|
||||
final branch = Branch.lookup(repo: repo, name: name);
|
||||
bindings.delete(branch.pointer);
|
||||
branch.free();
|
||||
}
|
||||
|
||||
/// Renames an existing local branch reference.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue