DRY cleanup of branchesAndTagsResults function

7e91e5198a99904b6eb94e965a3113afc3b78984

Tucker McKnight <tmcknight@instructure.com> | Sat Jun 20 2026

DRY cleanup of branchesAndTagsResults function

Also fix bug where I was calling ref.type, which is undefined. It's
data.currentRefType on that page.
js_templates/common/branchesListItems.ts:82
Before
81
82
83
84
85
86
      </li>
    </ul>
    <div id="branches-and-tags-list">
      ${branchesAndTagsResults(rels, defaultBranch, currentRef, currentRefType, sortBy)}
    </div>
  </div>`
}
After
81
82
83
84
85
86
      </li>
    </ul>
    <div id="branches-and-tags-list">
      ${branchesAndTagsResults(refs, defaultBranch, currentRef, currentRefType, sortBy)}
    </div>
  </div>`
}
js_templates/common/htmlPage.ts:47
Before
46
47
48
49
50
51
        window.branchesWithHrefs = ${JSON.stringify(branchesWithHrefs)};
        window.defaultBranch = "${repo.defaultBranch}";
        window.currentRef = "${ref.name}";
        window.currentRefType = "${ref.type}";
        window.cloneUrl = "${repo.cloneUrl}";
      `)),
      m('link', {
After
46
47
48
49
50
51
        window.branchesWithHrefs = ${JSON.stringify(branchesWithHrefs)};
        window.defaultBranch = "${repo.defaultBranch}";
        window.currentRef = "${ref.name}";
        window.currentRefType = "${data.currentRefType}";
        window.cloneUrl = "${repo.cloneUrl}";
      `)),
      m('link', {