| | |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.concurrent.atomic.AtomicLong; |
| | | |
| | | import com.google.inject.Inject; |
| | | import com.google.inject.Singleton; |
| | | |
| | | import org.eclipse.jgit.api.errors.ConcurrentRefUpdateException; |
| | | import org.eclipse.jgit.api.errors.JGitInternalException; |
| | | import org.eclipse.jgit.dircache.DirCache; |
| | |
| | | import com.gitblit.utils.ArrayUtils; |
| | | import com.gitblit.utils.JGitUtils; |
| | | import com.gitblit.utils.StringUtils; |
| | | import com.google.inject.Inject; |
| | | import com.google.inject.Singleton; |
| | | |
| | | /** |
| | | * Implementation of a ticket service based on an orphan branch. All tickets |
| | |
| | | |
| | | @Override |
| | | public BranchTicketService start() { |
| | | log.info("{} started", getClass().getSimpleName()); |
| | | return this; |
| | | } |
| | | |
| | |
| | | log.error("failed to read " + file, e); |
| | | } finally { |
| | | if (rw != null) { |
| | | rw.release(); |
| | | rw.close(); |
| | | } |
| | | } |
| | | return null; |
| | |
| | | } catch (IOException e) { |
| | | log.error("", e); |
| | | } finally { |
| | | inserter.release(); |
| | | inserter.close(); |
| | | } |
| | | } |
| | | |
| | |
| | | } finally { |
| | | // release the treewalk |
| | | if (treeWalk != null) { |
| | | treeWalk.release(); |
| | | treeWalk.close(); |
| | | } |
| | | } |
| | | } finally { |
| | |
| | | // finish the index |
| | | builder.finish(); |
| | | } finally { |
| | | inserter.release(); |
| | | inserter.close(); |
| | | } |
| | | return newIndex; |
| | | } |
| | |
| | | List<DirCacheEntry> list = new ArrayList<DirCacheEntry>(); |
| | | TreeWalk tw = null; |
| | | try { |
| | | tw = new TreeWalk(db); |
| | | ObjectId treeId = db.resolve(BRANCH + "^{tree}"); |
| | | if (treeId == null) { |
| | | // branch does not exist yet, could be migrating tickets |
| | | return list; |
| | | } |
| | | tw = new TreeWalk(db); |
| | | int hIdx = tw.addTree(treeId); |
| | | tw.setRecursive(true); |
| | | |
| | |
| | | } |
| | | } finally { |
| | | if (tw != null) { |
| | | tw.release(); |
| | | tw.close(); |
| | | } |
| | | } |
| | | return list; |
| | |
| | | rc)); |
| | | } |
| | | } finally { |
| | | revWalk.release(); |
| | | revWalk.close(); |
| | | } |
| | | } finally { |
| | | odi.release(); |
| | | odi.close(); |
| | | } |
| | | return success; |
| | | } |