Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.Config$State


  public void indexWithGitmodules() throws Exception {
    final ObjectId subId = ObjectId
        .fromString("abcd1234abcd1234abcd1234abcd1234abcd1234");
    final String path = "sub";

    final Config gitmodules = new Config();
    gitmodules.setString(CONFIG_SUBMODULE_SECTION, path, CONFIG_KEY_PATH,
        "sub");
    // Different config in the index should be overridden by the working tree.
    gitmodules.setString(CONFIG_SUBMODULE_SECTION, path, CONFIG_KEY_URL,
        "git://example.com/bad");
    final RevBlob gitmodulesBlob = testDb.blob(gitmodules.toText());

    gitmodules.setString(CONFIG_SUBMODULE_SECTION, path, CONFIG_KEY_URL,
        "git://example.com/sub");
    writeTrashFile(DOT_GIT_MODULES, gitmodules.toText());

    DirCache cache = db.lockDirCache();
    DirCacheEditor editor = cache.editor();
    editor.add(new PathEdit(path) {
View Full Code Here


  public void treeIdWithGitmodules() throws Exception {
    final ObjectId subId = ObjectId
        .fromString("abcd1234abcd1234abcd1234abcd1234abcd1234");
    final String path = "sub";

    final Config gitmodules = new Config();
    gitmodules.setString(CONFIG_SUBMODULE_SECTION, path, CONFIG_KEY_PATH,
        "sub");
    gitmodules.setString(CONFIG_SUBMODULE_SECTION, path, CONFIG_KEY_URL,
        "git://example.com/sub");

    RevCommit commit = testDb.getRevWalk().parseCommit(testDb.commit()
        .noParents()
        .add(DOT_GIT_MODULES, gitmodules.toText())
        .edit(new PathEdit(path) {

              public void apply(DirCacheEntry ent) {
                ent.setFileMode(FileMode.GITLINK);
                ent.setObjectId(subId);
View Full Code Here

  public void testTreeIteratorWithGitmodules() throws Exception {
    final ObjectId subId = ObjectId
        .fromString("abcd1234abcd1234abcd1234abcd1234abcd1234");
    final String path = "sub";

    final Config gitmodules = new Config();
    gitmodules.setString(CONFIG_SUBMODULE_SECTION, path, CONFIG_KEY_PATH,
        "sub");
    gitmodules.setString(CONFIG_SUBMODULE_SECTION, path, CONFIG_KEY_URL,
        "git://example.com/sub");

    RevCommit commit = testDb.getRevWalk().parseCommit(testDb.commit()
        .noParents()
        .add(DOT_GIT_MODULES, gitmodules.toText())
        .edit(new PathEdit(path) {

              public void apply(DirCacheEntry ent) {
                ent.setFileMode(FileMode.GITLINK);
                ent.setObjectId(subId);
View Full Code Here

public class RemoteConfigTest {
  private Config config;

  @Before
  public void setUp() throws Exception {
    config = new Config();
  }
View Full Code Here

  public void setUp() throws Exception {
    config = new Config();
  }

  private void readConfig(final String dat) throws ConfigInvalidException {
    config = new Config();
    config.fromText(dat);
  }
View Full Code Here

              modulesConfig = new BlobBasedConfig(null, repository,
                  configWalk.getObjectId(0));
              return this;
            }
          }
          modulesConfig = new Config();
        } finally {
          if (idx > 0)
            rootTree.next(idx);
        }
      } finally {
View Full Code Here

    diffCollector = new DiffCollector();
  }

  protected FollowFilter follow(final String followPath) {
    FollowFilter followFilter =
      FollowFilter.create(followPath, new Config().get(DiffConfig.KEY));
    followFilter.setRenameCallback(diffCollector);
    rw.setTreeFilter(followFilter);
    return followFilter;
  }
View Full Code Here

            "Missing commit message.", null));
      }

      Git git = new Git(db);
      CommitCommand cc = git.commit();
      Config config = git.getRepository().getConfig();

      boolean amend = Boolean.parseBoolean(requestObject.optString(GitConstants.KEY_COMMIT_AMEND, null));
      boolean insertChangeId = config.getBoolean(ConfigConstants.CONFIG_GERRIT_SECTION, ConfigConstants.CONFIG_KEY_CREATECHANGEID, false)
          || Boolean.parseBoolean(requestObject.optString(GitConstants.KEY_CHANGE_ID, null));

      String committerName = requestObject.optString(GitConstants.KEY_COMMITTER_NAME, null);
      String committerEmail = requestObject.optString(GitConstants.KEY_COMMITTER_EMAIL, null);
      String authorName = requestObject.optString(GitConstants.KEY_AUTHOR_NAME, null);
View Full Code Here

      protected void configure() {
        bind(new TypeLiteral<SchemaFactory<ReviewDb>>() {}).toInstance(db);
        bind(SitePaths.class).toInstance(paths);
        install(new SchemaVersion.Module());

        Config cfg = new Config();
        cfg.setString("gerrit", null, "basePath", "git");
        cfg.setString("user", null, "name", "Gerrit Code Review");
        cfg.setString("user", null, "email", "gerrit@localhost");

        bind(Config.class) //
            .annotatedWith(GerritServerConfig.class) //
            .toInstance(cfg);
View Full Code Here

    init();
  }

  private void init() {
    final Config cfg = new Config();
    try {
      cfg.fromText(read(RESOURCE_FILE));
    } catch (IOException e) {
      throw new RuntimeException(e.getMessage(), e);
    } catch (ConfigInvalidException e) {
      throw new RuntimeException(e.getMessage(), e);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.lib.Config$State

Copyright © 2018 www.massapicom. 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.