Return header if no branches match current ref (or null if empty repo)
This commit is contained in:
parent
32ef5d50cd
commit
9dc5296a61
1 changed files with 11 additions and 1 deletions
|
@ -21,7 +21,17 @@ class BranchesManager @Inject constructor() {
|
|||
.repository
|
||||
.fullBranch
|
||||
|
||||
return branchList.firstOrNull { it.name == branchName }
|
||||
var branchFound = branchList.firstOrNull {
|
||||
it.name == branchName
|
||||
}
|
||||
|
||||
if(branchFound == null) {
|
||||
branchFound = branchList.firstOrNull {
|
||||
it.objectId.name == branchName // Try to get the HEAD
|
||||
}
|
||||
}
|
||||
|
||||
return branchFound
|
||||
}
|
||||
|
||||
suspend fun getBranches(git: Git) = withContext(Dispatchers.IO) {
|
||||
|
|
Loading…
Reference in a new issue