Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.StoredConfig.save()


      db.create(true /* bare */);

      StoredConfig config = db.getConfig();
      config.setBoolean(ConfigConstants.CONFIG_CORE_SECTION,
        null, ConfigConstants.CONFIG_KEY_LOGALLREFUPDATES, true);
      config.save();

      onCreateProject(name);

      return db;
    } catch (IOException e1) {
View Full Code Here


    dst = new FileRepositoryBuilder().setGitDir(new File(gitdir)).build();
    dst.create();
    final StoredConfig dstcfg = dst.getConfig();
    dstcfg.setBoolean("core", null, "bare", false); //$NON-NLS-1$ //$NON-NLS-2$
    dstcfg.save();
    db = dst;

    outw.print(MessageFormat.format(
        CLIText.get().initializedEmptyGitRepositoryIn, gitdir));
    outw.println();
View Full Code Here

    rc.addURI(uri);
    rc.addFetchRefSpec(new RefSpec().setForceUpdate(true)
        .setSourceDestination(Constants.R_HEADS + "*", //$NON-NLS-1$
            Constants.R_REMOTES + remoteName + "/*")); //$NON-NLS-1$
    rc.update(dstcfg);
    dstcfg.save();
  }

  private FetchResult runFetch() throws URISyntaxException, IOException {
    final Transport tn = Transport.open(db, remoteName);
    final FetchResult r;
View Full Code Here

   
    StoredConfig config = repo.getRepository().getConfig();
   
    config.setString("remote", "heroku", "url", remoteUrl);
   
    config.save();

    log("Pushing from %s to %s", stagingDirectory, remoteUrl);

    JschConfigSessionFactory sessionFactory = new JschConfigSessionFactory() {
      @Override
View Full Code Here

       
        //setup tracking
        StoredConfig config = git.getRepository().getConfig();
        config.setString(ConfigConstants.CONFIG_BRANCH_SECTION,prefixedBranchName, ConfigConstants.CONFIG_KEY_REMOTE,"origin");
        config.setString(ConfigConstants.CONFIG_BRANCH_SECTION,prefixedBranchName, ConfigConstants.CONFIG_KEY_MERGE,Constants.R_HEADS + prefixedBranchName);
        config.save();
       
        //checkout the branch
        git.checkout().setName(prefixedBranchName).call();
       
        return null;
View Full Code Here

              ConfigConstants.CONFIG_BRANCH_SECTION, newName,
              name, Arrays.asList(values));
        }
        repoConfig.unsetSection(ConfigConstants.CONFIG_BRANCH_SECTION,
            shortOldName);
        repoConfig.save();
      }

      Ref resultRef = repo.getRef(newName);
      if (resultRef == null)
        throw new JGitInternalException(
View Full Code Here

          config.setString(ConfigConstants.CONFIG_BRANCH_SECTION,
              name, ConfigConstants.CONFIG_KEY_REMOTE, ".");
          config.setString(ConfigConstants.CONFIG_BRANCH_SECTION,
              name, ConfigConstants.CONFIG_KEY_MERGE, baseBranch);
        }
        config.save();
      }
      return result;
    } catch (IOException ioe) {
      throw new JGitInternalException(ioe.getMessage(), ioe);
    } finally {
View Full Code Here

                //setup tracking
                StoredConfig config = git.getRepository().getConfig();
                config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, prefixedBranchName, ConfigConstants.CONFIG_KEY_REMOTE, "origin");
                config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, prefixedBranchName, ConfigConstants.CONFIG_KEY_MERGE, Constants.R_HEADS + prefixedBranchName);
                config.save();
            }

            return newBranch;

        }
View Full Code Here

                //setup tracking
                StoredConfig config = git.getRepository().getConfig();
                config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, prefixedHotfixName, ConfigConstants.CONFIG_KEY_REMOTE, "origin");
                config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, prefixedHotfixName, ConfigConstants.CONFIG_KEY_MERGE, Constants.R_HEADS + prefixedHotfixName);
                config.save();
            }

            return newBranch;
        }
        catch (GitAPIException e)
View Full Code Here

          }
          repoConfig
              .unsetSection(
                  ConfigConstants.CONFIG_BRANCH_SECTION,
                  shortOldName);
          repoConfig.save();
        }

      } else
        throw new JGitInternalException(MessageFormat.format(JGitText
            .get().renameBranchUnexpectedResult, renameResult
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.