File tree Expand file tree Collapse file tree
scala-git/src/main/scala/com/madgag/git Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,19 +18,16 @@ package com.madgag
1818
1919import java .io .File
2020import java .nio .charset .Charset
21-
2221import _root_ .scala .jdk .CollectionConverters ._
2322import _root_ .scala .annotation .tailrec
2423import _root_ .scala .language .implicitConversions
2524import _root_ .scala .util .{Success , Try }
26-
27-
2825import org .eclipse .jgit
2926import org .eclipse .jgit .api .Git
3027import org .eclipse .jgit .diff .DiffAlgorithm .SupportedAlgorithm
3128import org .eclipse .jgit .diff ._
3229import org .eclipse .jgit .internal .storage .file .ObjectDirectory
33- import org .eclipse .jgit .lib .Constants .OBJ_BLOB
30+ import org .eclipse .jgit .lib .Constants .{ OBJ_BLOB , R_HEADS }
3431import org .eclipse .jgit .lib .ObjectInserter .Formatter
3532import org .eclipse .jgit .lib .ObjectReader .OBJ_ANY
3633import org .eclipse .jgit .lib ._
@@ -95,7 +92,10 @@ package object git {
9592 }
9693
9794 def nonSymbolicRefs = repo.getRefDatabase.getRefs.asScala.filterNot(_.isSymbolic).toSeq
95+ }
9896
97+ implicit class RichRefDatabase (refDatabase : RefDatabase ) {
98+ val branchRefs : Seq [Ref ] = refDatabase.getRefsByPrefix(R_HEADS ).asScala.toSeq
9999 }
100100
101101 implicit class RichString (str : String ) {
You can’t perform that action at this time.
0 commit comments