mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 15:05:50 +01:00
Remove unused code
This commit is contained in:
@@ -37,15 +37,4 @@ object ControlUtil {
|
|||||||
def using[T](treeWalk: TreeWalk)(f: TreeWalk => T): T =
|
def using[T](treeWalk: TreeWalk)(f: TreeWalk => T): T =
|
||||||
try f(treeWalk) finally treeWalk.release()
|
try f(treeWalk) finally treeWalk.release()
|
||||||
|
|
||||||
|
|
||||||
// def withTmpRefSpec[T](ref: RefSpec, git: Git)(f: RefSpec => T): T = {
|
|
||||||
// try {
|
|
||||||
// f(ref)
|
|
||||||
// } finally {
|
|
||||||
// val refUpdate = git.getRepository.updateRef(ref.getDestination)
|
|
||||||
// refUpdate.setForceUpdate(true)
|
|
||||||
// refUpdate.delete()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,24 +31,6 @@ object FileUtil {
|
|||||||
|
|
||||||
def isText(content: Array[Byte]): Boolean = !content.contains(0)
|
def isText(content: Array[Byte]): Boolean = !content.contains(0)
|
||||||
|
|
||||||
// def createZipFile(dest: File, dir: File): Unit = {
|
|
||||||
// def addDirectoryToZip(out: ZipArchiveOutputStream, dir: File, path: String): Unit = {
|
|
||||||
// dir.listFiles.map { file =>
|
|
||||||
// if(file.isFile){
|
|
||||||
// out.putArchiveEntry(new ZipArchiveEntry(path + "/" + file.getName))
|
|
||||||
// out.write(FileUtils.readFileToByteArray(file))
|
|
||||||
// out.closeArchiveEntry
|
|
||||||
// } else if(file.isDirectory){
|
|
||||||
// addDirectoryToZip(out, file, path + "/" + file.getName)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// using(new ZipArchiveOutputStream(dest)){ out =>
|
|
||||||
// addDirectoryToZip(out, dir, dir.getName)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
def getFileName(path: String): String = defining(path.lastIndexOf('/')){ i =>
|
def getFileName(path: String): String = defining(path.lastIndexOf('/')){ i =>
|
||||||
if(i >= 0) path.substring(i + 1) else path
|
if(i >= 0) path.substring(i + 1) else path
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user