Package org.eclipse.jgit.dircache

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


      dce.setObjectId(inserter.insert(Constants.OBJ_BLOB, len, in));
      in.close();
      builder.add(dce);
      treeItr.next(1);
    }
    builder.commit();
    inserter.flush();
    inserter.release();
  }

  /**
 
View Full Code Here


            // the file or symlink named by the tree entry.
            delete(path);
          }
        }
      }
      builder.commit();
      setCallable(false);
    } catch (IOException e) {
      throw new JGitInternalException(
          JGitText.get().exceptionCaughtDuringExecutionOfRmCommand, e);
    } finally {
View Full Code Here

              builder.add(c.getDirCacheEntry());
          }
        }
      }
      inserter.flush();
      builder.commit();
      setCallable(false);
    } catch (IOException e) {
      throw new JGitInternalException(
          JGitText.get().exceptionCaughtDuringExecutionOfAddCommand, e);
    } finally {
View Full Code Here

    DirCache index = db.lockDirCache();
    DirCacheBuilder builder = index.builder();
    builder.add(createEntry(file, FileMode.REGULAR_FILE, 1, ""));
    builder.add(createEntry(file, FileMode.REGULAR_FILE, 2, ""));
    builder.add(createEntry(file, FileMode.REGULAR_FILE, 3, ""));
    assertTrue(builder.commit());

    assertEquals("[a.txt, mode:100644, stage:1]"
        + "[a.txt, mode:100644, stage:2]"
        + "[a.txt, mode:100644, stage:3]",
        indexState(0));
View Full Code Here

    DirCacheBuilder builder = index.builder();
    builder.add(createEntry(file, FileMode.REGULAR_FILE, 1, ""));
    builder.add(createEntry(file, FileMode.REGULAR_FILE, 2, ""));
    builder.add(createEntry(file, FileMode.REGULAR_FILE, 3, ""));
    builder.add(createEntry("b.txt", FileMode.REGULAR_FILE));
    assertTrue(builder.commit());

    assertEquals("[a.txt, mode:100644, stage:1]"
        + "[a.txt, mode:100644, stage:2]"
        + "[a.txt, mode:100644, stage:3]"
        + "[b.txt, mode:100644]",
View Full Code Here

    writer.print("our content");
    writer.close();
    addEntryToBuilder("a.txt", file, newObjectInserter, builder, 2)
        .getObjectId();

    builder.commit();

    assertEquals(
        "[a.txt, mode:100644, stage:1, content:content]" +
        "[a.txt, mode:100644, stage:2, content:our content]" +
        "[a.txt, mode:100644, stage:3, content:other content]" +
View Full Code Here

        }

        builder.add(entry);
      }

      builder.commit();
    } finally {
      dc.unlock();
      if (walk != null)
        walk.release();
    }
View Full Code Here

          entry.setObjectId(tree.getEntryObjectId());
          builder.add(entry);
        }
      }

      builder.commit();
    } catch (IOException e) {
      throw new RuntimeException(e);
    } finally {
      if (dc != null)
        dc.unlock();
View Full Code Here

        }

        builder.add(entry);
      }

      builder.commit();
    } finally {
      dc.unlock();
      if (walk != null)
        walk.release();
    }
View Full Code Here

        "second file content - master");
    builder.add(entry);
    entry = createEntry("b", FileMode.REGULAR_FILE, 3,
        "second file content - branch");
    builder.add(entry);
    builder.commit();

    FileTreeIterator iterator = new FileTreeIterator(db);
    IndexDiff diff = new IndexDiff(db, Constants.HEAD, iterator);
    diff.diff();
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.