|
1 | 1 |
|
2 | 2 | // create a repository object |
3 | | -function createRepoObj(fullName, selBranch, pushAccess, |
4 | | - branches, private, isFork, empty) { |
| 3 | +function createRepoObj(fullName, selBranch, defaultBranch, |
| 4 | + pushAccess, branches, private, |
| 5 | + isFork, empty) { |
5 | 6 |
|
6 | 7 | return { |
7 | 8 | fullName, |
8 | 9 | selBranch, |
| 10 | + defaultBranch, |
9 | 11 | pushAccess, |
10 | 12 | branches, |
11 | 13 | private, |
@@ -42,6 +44,14 @@ function updateModRepoSelectedBranch(fullName, selBranch) { |
42 | 44 |
|
43 | 45 | } |
44 | 46 |
|
| 47 | +function updateModRepoDefaultBranch(fullName, defaultBranch) { |
| 48 | + |
| 49 | + modifiedRepos[fullName].defaultBranch = defaultBranch; |
| 50 | + |
| 51 | + updateModReposLS(); |
| 52 | + |
| 53 | +} |
| 54 | + |
45 | 55 | function updateModRepoPushAccess(fullName, pushAccess) { |
46 | 56 |
|
47 | 57 | modifiedRepos[fullName].pushAccess = pushAccess; |
@@ -90,7 +100,7 @@ async function fetchRepoAndSaveToModRepos(treeLoc) { |
90 | 100 |
|
91 | 101 | // create temporary repo object |
92 | 102 | const tempRepoObj = createRepoObj(fullName, selBranch, null, |
93 | | - null, null, null, null); |
| 103 | + null, null, null, null, null); |
94 | 104 |
|
95 | 105 | // add temp repo object |
96 | 106 | // to modified repos |
@@ -120,6 +130,8 @@ async function fetchRepoAndSaveToModRepos(treeLoc) { |
120 | 130 |
|
121 | 131 | (tempRepo.selBranch ?? repo.default_branch), |
122 | 132 |
|
| 133 | + repo.default_branch, |
| 134 | + |
123 | 135 | (tempRepo.pushAccess ?? ((repo.permissions && repo.permissions.push) ?? false)), |
124 | 136 |
|
125 | 137 | (tempRepo.branches ?? null), |
|
0 commit comments