/** {@inheritDoc} */ public void add(String filePattern) throws GitException, InterruptedException { proxy.add(filePattern); }
/** {@inheritDoc} */ public void add(String filePattern) throws GitException, InterruptedException { if (Git.USE_CLI) super.add(filePattern); else jgit.add(filePattern); }
public void commitWorkingCopy(final String commitMessage) throws IOException, InterruptedException { GitClient client = getGitClient(null); debuggingLogger.fine("Adding all files in the current directory"); client.add("-u"); debuggingLogger.fine(String.format("Committing working copy with message '%s'", commitMessage)); client.commit(commitMessage); }
protected void makeCombination(Map<IndexEntry, Revision> settings) throws InterruptedException { // Assume we are checked out String name = "combine-" + tid + "-" + (idx++); git.branch(name); git.checkout(name); StringBuilder commit = new StringBuilder( "Jenkins generated combination of:\n"); for (Entry<IndexEntry, Revision> setting : settings.entrySet()) { commit.append(' ').append(' '); commit.append(setting.getKey().getFile()); commit.append(' '); commit.append(setting.getValue()); commit.append('\n'); } listener.getLogger().print(commit); for (Entry<IndexEntry, Revision> setting : settings.entrySet()) { IndexEntry submodule = setting.getKey(); Revision branch = setting.getValue(); GitClient subGit = git.subGit(submodule.getFile()); subGit.checkout(branch.getSha1().name()); git.add(submodule.getFile()); } git.commit(commit.toString()); }
@Override public Boolean invoke(File localWorkspace, VirtualChannel channel) throws IOException, InterruptedException { File gitClonePath = localWorkspace; if (gitPrefix != null) { gitClonePath = new File(localWorkspace, gitPrefix); } GitClient git = Git.with(listener, environment) .in(gitClonePath).using(gitExe) .getClient(); if (git.hasGitRepo()) { PersonIdent person = new PersonIdent(accountName, accountEmail); for (String module: modules) { git.add(new File(module, "debian/changelog").getCanonicalPath()); } git.setAuthor(person); git.setCommitter(person); git.commit(commitMessage); return true; } else { return false; } }