public Boolean invoke(File localWorkspace, VirtualChannel channel) throws IOException { IGitAPI git = new GitAPI(gitExe, new FilePath(localWorkspace), listener, environment); if (git.hasGitRepo()) { // Repo is there - do a fetch listener.getLogger().println("Fetching changes from the remote Git repositories"); // Fetch updates for (RemoteConfig remoteRepository : paramRepos) { fetchFrom(git, listener, remoteRepository); } listener.getLogger().println("Polling for changes in"); Collection<Revision> origCandidates = buildChooser.getCandidateRevisions( true, singleBranch, git, listener, buildData); List<Revision> candidates = new ArrayList<Revision>(); for (Revision c : origCandidates) { if (!isRevExcluded(git, c, listener)) { candidates.add(c); } } return (candidates.size() > 0); } else { listener.getLogger().println("No Git repository yet, an initial checkout is required"); return true; } } });
public GitClient invoke(File f, VirtualChannel channel) throws IOException, InterruptedException { if (listener == null) listener = TaskListener.NULL; if (env == null) env = new EnvVars(); if (exe == null || JGitTool.MAGIC_EXENAME.equalsIgnoreCase(exe)) { return new JGitAPIImpl(f, listener); } if (JGitApacheTool.MAGIC_EXENAME.equalsIgnoreCase(exe)) { final PreemptiveAuthHttpClientConnectionFactory factory = new PreemptiveAuthHttpClientConnectionFactory(); return new JGitAPIImpl(f, listener, factory); } // Ensure we return a backward compatible GitAPI, even API only claim to provide a GitClient return new GitAPI(exe, f, listener, env); } }
workspace = workspace.child(entry.getKey()); IGitAPI git = new GitAPI(gitExe, workspace, listener, environment);
public Boolean invoke(File workspace, VirtualChannel channel) throws IOException { IGitAPI git = new GitAPI(gitExe, new FilePath(workspace), listener, environment); RemoteConfig remote = gitSCM.getRepositoryByName(targetRepo); if (remote == null) { listener.getLogger() .println("No repository found for target repo name " + targetRepo); return false; } listener.getLogger().println("Pushing HEAD to branch " + branchName + " at repo " + targetRepo); git.push(remote, "HEAD:" + branchName); return true; } });
public Boolean invoke(File workspace, VirtualChannel channel) throws IOException { IGitAPI git = new GitAPI( gitExe, new FilePath(workspace), listener, environment);
Revision branch = settings.get(submodule); File subdir = new File(workspace, submodule.getFile()); IGitAPI subGit = new GitAPI(git.getGitExe(), new FilePath(subdir), listener, git.getEnvironment());
IGitAPI git = new GitAPI(gitExe, new FilePath(localWorkspace), listener, environment);
public Boolean invoke(File workspace, VirtualChannel channel) throws IOException { IGitAPI git = new GitAPI( gitExe, new FilePath(workspace), listener, environment);
public Boolean invoke(File workspace, VirtualChannel channel) throws IOException { IGitAPI git = new GitAPI(gitExe, new FilePath(workspace), listener, environment); try { RemoteConfig remote = gitSCM.getRepositoryByName(targetRepo); if (remote == null) { listener.getLogger() .println("No repository found for target repo name " + targetRepo); return false; } listener.getLogger().println("Pushing HEAD to branch " + branchName + " at repo " + targetRepo); git.push(remote, "HEAD:" + branchName); } finally { git.close(); } return true; } });
IGitAPI subGit = new GitAPI(git.getGitExe(), new FilePath(subdir), listener, git.getEnvironment());
IGitAPI subGit = new GitAPI(git.getGitExe(), new FilePath(subdir), listener, git.getEnvironment());
protected void makeCombination(Map<IndexEntry, Revision> settings) { // Assume we are checked out String name = "combine-" + tid + "-" + (idx++); git.branch(name); git.checkout(name); String commit = "Hudson generated combination of:\n"; for (IndexEntry submodule : settings.keySet()) { Revision branch = settings.get(submodule); commit += " " + submodule.getFile() + " " + branch.toString() + "\n"; } listener.getLogger().print(commit); for (IndexEntry submodule : settings.keySet()) { Revision branch = settings.get(submodule); File subdir = new File(workspace, submodule.getFile()); IGitAPI subGit = new GitAPI(git.getGitExe(), new FilePath(subdir), listener, git.getEnvironment()); try { subGit.checkout(branch.sha1.name()); git.add(submodule.file); } finally { subGit.close(); } } git.commit(commit); }
public Boolean invoke(File workspace, VirtualChannel channel) throws IOException { IGitAPI git = new GitAPI(gitExe, new FilePath(workspace), listener, environment); RemoteConfig remote = gitSCM.getRepositoryByName(targetRepo); if (remote == null) { listener.getLogger() .println("No repository found for target repo name " + targetRepo); return false; } if (t.isCreateTag()) { if (git.tagExists(tagName)) { listener.getLogger() .println("Tag " + tagName + " already exists and Create Tag is specified, so failing."); return false; } git.tag(tagName, "Hudson Git plugin tagging with " + tagName); } else if (!git.tagExists(tagName)) { listener.getLogger() .println("Tag " + tagName + " does not exist and Create Tag is not specified, so failing."); return false; } listener.getLogger().println("Pushing tag " + tagName + " to repo " + targetRepo); git.push(remote, tagName); return true; } });
public Boolean invoke(File workspace, VirtualChannel channel) throws IOException { IGitAPI git = new GitAPI(gitExe, new FilePath(workspace), listener, environment); try {
"Trying to fetch " + submodule.getFile() + " into " + subdir); IGitAPI subGit = new GitAPI(git.getGitExe(), new FilePath(subdir), listener, git.getEnvironment());
"Trying to fetch " + submodule.getFile() + " into " + subdir); IGitAPI subGit = new GitAPI(git.getGitExe(), new FilePath(subdir), listener, git.getEnvironment());
public BuildConfig invoke(File localWorkspace, VirtualChannel channel) throws IOException { IGitAPI git = new GitAPI(gitExe, new FilePath(localWorkspace), listener, environment);
public BuildConfig invoke(File localWorkspace, VirtualChannel channel) throws IOException { IGitAPI git = new GitAPI(gitExe, new FilePath(localWorkspace), listener, environment);
public BuildConfig invoke(File localWorkspace, VirtualChannel channel) throws IOException { IGitAPI git = new GitAPI(gitExe, new FilePath(localWorkspace), listener, environment);
public BuildConfig invoke(File localWorkspace, VirtualChannel channel) throws IOException { IGitAPI git = new GitAPI(gitExe, new FilePath(localWorkspace), listener, environment);