From a1a5e2771ad132a8a6db18a80ee07b3b37ebafc6 Mon Sep 17 00:00:00 2001 From: Inhere Date: Fri, 28 Oct 2022 21:39:31 +0800 Subject: [PATCH] up: update some for handle branch info --- src/Info/BranchInfos.php | 14 +------------- src/Repo.php | 2 +- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/Info/BranchInfos.php b/src/Info/BranchInfos.php index 08faa18..c9a7201 100644 --- a/src/Info/BranchInfos.php +++ b/src/Info/BranchInfos.php @@ -124,18 +124,6 @@ public function parse(): self return $this; } - /** - * @param string $name - * - * @return BranchInfo|null - */ - public function findOne(string $name): ?BranchInfo - { - $list = $this->search($name); - - return $list ? $list[0] : null; - } - /** * @param string $kw * @param int $limit @@ -176,7 +164,7 @@ public function search(string $kw, int $limit = 3): array * * @return BranchInfo|null */ - public function getBranchInfo(string $name, string $from = self::FROM_LOCAL): ?BranchInfo + public function getByName(string $name, string $from = self::FROM_LOCAL): ?BranchInfo { if ($from === self::FROM_LOCAL) { return $this->localBranches[$name] ?? null; diff --git a/src/Repo.php b/src/Repo.php index 561732a..983eac4 100644 --- a/src/Repo.php +++ b/src/Repo.php @@ -341,7 +341,7 @@ public function getBranchInfo(string $name, string $remote = ''): BranchInfo $name = $remote . '/' . $name; } - return $bis->getBranchInfo($name, $from); + return $bis->getByName($name, $from); } /**