refactor: use nullable strings instead of empty in arguments

This commit is contained in:
Aleksey Kulikov 2021-09-27 11:44:16 +03:00
parent 5401717713
commit b5561212e0
7 changed files with 57 additions and 62 deletions

View file

@ -13,12 +13,11 @@ import '../util.dart';
Pointer<git_oid> stash(
Pointer<git_repository> repo,
Pointer<git_signature> stasher,
String message,
String? message,
int flags,
) {
final out = calloc<git_oid>();
final messageC =
message.isNotEmpty ? message.toNativeUtf8().cast<Int8>() : nullptr;
final messageC = message?.toNativeUtf8().cast<Int8>() ?? nullptr;
final error = libgit2.git_stash_save(out, repo, stasher, messageC, flags);
if (error < 0) {