Package org.eclipse.jgit.dircache

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


    final DirCache cache = db.readDirCache();
    if (!cache.lock())
      throw die(CLIText.get().failedToLockIndex);
    cache.read();
    cache.write();
    if (!cache.commit())
      throw die(CLIText.get().failedToCommitIndex);
  }
}
View Full Code Here


    assertNotNull(git.checkout().setName(Constants.MASTER).call());

    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);
View Full Code Here

    assertNotNull(git.checkout().setName(Constants.MASTER).call());

    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);
View Full Code Here

    final DirCache dirc = db.lockDirCache();
    final DirCacheEntry ent = dirc.getEntry(path);
    if (ent != null)
      ent.setAssumeValid(true);
    dirc.write();
    if (!dirc.commit())
      throw new IOException("could not commit");
  }

}
View Full Code Here

    DirCacheEntry entry = cache.getEntry("Test.txt");
    assertNotNull(entry);
    entry.setLength(0);
    entry.setLastModified(0);
    cache.write();
    assertTrue(cache.commit());

    cache = DirCache.read(db.getIndexFile(), db.getFS());
    entry = cache.getEntry("Test.txt");
    assertNotNull(entry);
    assertEquals(0, entry.getLength());
View Full Code Here

    final DirCache dirc = db.lockDirCache();
    final DirCacheEntry ent = dirc.getEntry(path);
    if (ent != null)
      ent.setAssumeValid(true);
    dirc.write();
    if (!dirc.commit())
      throw new IOException("could not commit");
  }

}
View Full Code Here

    cache = DirCache.lock(db.getIndexFile(), db.getFS());
    cache.getEntry("file1.txt").setLength(0);
    cache.getEntry("file2.txt").setLength(0);
    cache.getEntry("file3.txt").setLength(0);
    cache.write();
    assertTrue(cache.commit());

    // Verify entries smudged
    cache = DirCache.read(db.getIndexFile(), db.getFS());
    assertEquals(0, cache.getEntry("file1.txt").getLength());
    assertEquals(0, cache.getEntry("file2.txt").getLength());
View Full Code Here

    // Smudge entries
    cache = DirCache.lock(db.getIndexFile(), db.getFS());
    cache.getEntry("file1.txt").setLength(0);
    cache.getEntry("file2.txt").setLength(0);
    cache.write();
    assertTrue(cache.commit());

    // Verify entries smudged
    cache = db.readDirCache();
    assertEquals(0, cache.getEntry("file1.txt").getLength());
    assertEquals(0, cache.getEntry("file2.txt").getLength());
View Full Code Here

    DirCache cache = db.lockDirCache();
    cache.getEntry("executable").setFileMode(FileMode.EXECUTABLE_FILE);
    cache.getEntry("symlink").setFileMode(FileMode.SYMLINK);
    cache.write();
    cache.commit();
    cache.unlock();

    git.commit().setMessage("three files with different modes").call();

    final byte[] zipData = CLIGitCommand.rawExecute( //
View Full Code Here

    DirCache cache = db.lockDirCache();
    cache.getEntry("executable").setFileMode(FileMode.EXECUTABLE_FILE);
    cache.getEntry("symlink").setFileMode(FileMode.SYMLINK);
    cache.write();
    cache.commit();
    cache.unlock();

    git.commit().setMessage("three files with different modes").call();

    final byte[] archive = CLIGitCommand.rawExecute( //
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.