Package org.eclipse.jgit.dircache

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


            }
          });
        }
      }

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


    // there must be at least one change
    if (emptyCommit)
      throw new JGitInternalException(JGitText.get().emptyCommit);

    // update index
    dcEditor.commit();
    // finish temporary in-core index used for this commit
    dcBuilder.finish();
    return inCoreIndex;
  }
View Full Code Here

                        ent.getPathString()), e);
              }
            }
          });
        }
        editor.commit();
      } finally {
        startWalk.release();
        r.release();
      }
    } finally {
View Full Code Here

    // there must be at least one change
    if (emptyCommit)
      throw new JGitInternalException(JGitText.get().emptyCommit);

    // update index
    dcEditor.commit();
    // finish temporary in-core index used for this commit
    dcBuilder.finish();
    return inCoreIndex;
  }
View Full Code Here

            public void apply(DirCacheEntry ent) {
              ent.setObjectId(blobId);
            }
          });
        }
        editor.commit();
      }

      File workTree = repo.getWorkTree();
      for (String file : files)
        DirCacheCheckout.checkoutEntry(repo, new File(workTree, file),
View Full Code Here

            }
          });
        }
      }

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

            checkoutPath(ent, r);
          }
        }
      });
    }
    editor.commit();
  }

  private void checkoutPathsFromCommit(TreeWalk treeWalk, DirCache dc,
      RevCommit commit) throws IOException {
    treeWalk.addTree(commit.getTree());
View Full Code Here

          ent.setFileMode(mode);
          checkoutPath(ent, r);
        }
      });
    }
    editor.commit();
  }

  private void checkoutPath(DirCacheEntry entry, ObjectReader reader) {
    File file = new File(repo.getWorkTree(), entry.getPathString());
    File parentDir = file.getParentFile();
View Full Code Here

      public void apply(DirCacheEntry ent) {
        ent.setFileMode(FileMode.GITLINK);
        ent.setObjectId(id);
      }
    });
    editor.commit();

    Git.cloneRepository().setURI(db.getDirectory().toURI().toString())
        .setDirectory(new File(db.getWorkTree(), path)).call()
        .getRepository().close();
View Full Code Here

      public void apply(DirCacheEntry ent) {
        ent.setFileMode(FileMode.GITLINK);
        ent.setObjectId(id);
      }
    });
    editor.commit();

    File submoduleRoot = new File(db.getWorkTree(), path);
    assertTrue(submoduleRoot.mkdir());
    assertTrue(new File(submoduleRoot, Constants.DOT_GIT).mkdir());
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.