Skip to content

Commit

Permalink
up: update some for handle branch info
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Oct 28, 2022
1 parent d86c313 commit a1a5e27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
14 changes: 1 addition & 13 deletions src/Info/BranchInfos.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit a1a5e27

Please sign in to comment.