mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 10:16:16 +01:00
Refactored branches and changesets modules
This commit is contained in:
@@ -106,12 +106,21 @@ export function getBranchNames(state: Object, repository: Repository) {
|
||||
|
||||
export function getBranches(state: Object, repository: Repository) {
|
||||
const key = createKey(repository);
|
||||
return Object.values(state.branches[key].byNames);
|
||||
if (state.branches[key]) {
|
||||
if (state.branches[key].byNames) {
|
||||
return Object.values(state.branches[key].byNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function getBranch(state: Object, repository: Repository, name: string) {
|
||||
const key = createKey(repository);
|
||||
return state.branches[key].byNames[name];
|
||||
if (state.branches[key]) {
|
||||
if (state.branches[key].byNames[name]) {
|
||||
return state.branches[key].byNames[name];
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function createKey(repository: Repository) {
|
||||
|
||||
Reference in New Issue
Block a user