Package org.eclipse.jgit.dircache

Examples of org.eclipse.jgit.dircache.DirCache.unlock()


            FileUtils.delete(fileToDelete, FileUtils.RECURSIVE
                | FileUtils.RETRY);
        }
      }
    } finally {
      dc.unlock();
    }
    RevWalk rw = new RevWalk(repo);
    RevCommit commit = rw.parseCommit(repo.resolve(Constants.HEAD));
    rw.release();
    return commit;
View Full Code Here


      throw new JGitInternalException(
          JGitText.get().exceptionCaughtDuringExecutionOfAddCommand, e);
    } finally {
      inserter.release();
      if (dc != null)
        dc.unlock();
    }

    return dc;
  }
View Full Code Here

          }
        } finally {
          odi.release();
        }
      } finally {
        index.unlock();
      }
    } catch (UnmergedPathException e) {
      // since UnmergedPathException is a subclass of IOException
      // which should not be wrapped by a JGitInternalException we
      // have to catch and re-throw it here
View Full Code Here

    } catch (IOException e) {
      throw new JGitInternalException(
          JGitText.get().exceptionCaughtDuringExecutionOfRmCommand, e);
    } finally {
      if (dc != null)
        dc.unlock();
    }

    return dc;
  }
View Full Code Here

            FileUtils.delete(fileToDelete, FileUtils.RECURSIVE
                | FileUtils.RETRY);
        }
      }
    } finally {
      dc.unlock();
    }
    RevWalk rw = new RevWalk(repo);
    RevCommit commit = rw.parseCommit(repo.resolve(Constants.HEAD));
    rw.release();
    return commit;
View Full Code Here

      dcb.commit();
    } catch (IOException e) {
      throw e;
    } finally {
      if (dc != null)
        dc.unlock();
    }
  }

  private void checkoutIndex(RevCommit commit) throws IOException {
    DirCache dc = null;
View Full Code Here

      checkout.checkout();
    } catch (IOException e) {
      throw e;
    } finally {
      if (dc != null)
        dc.unlock();
    }
  }

  private void resetMerge() throws IOException {
    repo.writeMergeHeads(null);
View Full Code Here

        if (entry.getLength() > 0)
          assertEquals(entry.getLength(), r.getObjectSize(
              entry.getObjectId(), ObjectReader.OBJ_ANY));
      }
    } finally {
      dc.unlock();
      r.release();
    }
  }

  public void testCheckoutMixedNewlines() throws Exception {
View Full Code Here

    DirCache cache = db.lockDirCache();
    cache.getEntry("test.txt").setFileMode(FileMode.EXECUTABLE_FILE);
    cache.write();
    assertTrue(cache.commit());
    cache.unlock();

    assertNotNull(git.commit().setMessage("commit3").call());

    db.getFS().setExecute(file, false);
    git.getRepository()
View Full Code Here

    } catch (IOException e) {
      throw new JGitInternalException(
          JGitText.get().exceptionCaughtDuringExecutionOfRmCommand, e);
    } finally {
      if (dc != null)
        dc.unlock();
    }

    return dc;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.