Return header if no branches match current ref (or null if empty repo)
This commit is contained in:
parent
32ef5d50cd
commit
9dc5296a61
@ -21,7 +21,17 @@ class BranchesManager @Inject constructor() {
|
|||||||
.repository
|
.repository
|
||||||
.fullBranch
|
.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) {
|
suspend fun getBranches(git: Git) = withContext(Dispatchers.IO) {
|
||||||
|
Loading…
Reference in New Issue
Block a user