/** * getWorkTree. * * @return a {@link hudson.FilePath} object. */ public FilePath getWorkTree() { return proxy.getWorkTree(); }
/** * Creates a new blamer for Git. * * @param git * git client * @param gitCommit * content of environment variable GIT_COMMIT */ GitBlamer(final GitClient git, final String gitCommit) { this.workspace = git.getWorkTree(); this.git = git; this.gitCommit = gitCommit; }
/** * {@inheritDoc} */ @Override public void beforeCheckout(GitSCM scm, Run<?, ?> build, GitClient git, TaskListener listener) throws IOException, InterruptedException, GitException { listener.getLogger().println("Wiping out workspace first."); git.getWorkTree().deleteContents(); }
/** * Creates a new blamer for Git. * * @param git git client * @param gitCommit content of environment variable GIT_COMMIT * @param listener task listener to print logging statements to */ public GitBlamer(final GitClient git, @CheckForNull final String gitCommit, final TaskListener listener) { super(git.getWorkTree(), listener); this.git = git; this.gitCommit = StringUtils.defaultString(gitCommit, "HEAD"); log("Using GitBlamer to create author and commit information for all warnings.%n"); log("GIT_COMMIT=%s, workspace=%s%n", gitCommit, git.getWorkTree()); }
credentials.getPassword().getPlainText(), releaseRepository.getTargetRepoPrivateUri(), client.getWorkTree().toURI())); log(buildListener,"Push dry-run completed successfully");
@Override public Blames blame(final Report report) { try { report.logInfo("Invoking Git blamer to create author and commit information for all affected files"); report.logInfo("GIT_COMMIT env = '%s'", gitCommit); report.logInfo("Git working tree = '%s'", git.getWorkTree()); ObjectId headCommit = git.revParse(gitCommit); if (headCommit == null) { report.logError("Could not retrieve HEAD commit, aborting"); return new Blames(); } report.logInfo("Git commit ID = '%s'", headCommit.getName()); String workspacePath = getWorkspacePath(); report.logInfo("Job workspace = '%s'", workspacePath); return git.withRepository(new BlameCallback(report, headCommit, workspacePath)); } catch (IOException exception) { report.logException(exception, "Computing blame information failed with an exception:"); } catch (GitException exception) { report.logException(exception, "Can't determine head commit using 'git rev-parse'. Skipping blame."); } catch (InterruptedException e) { // nothing to do, already logged } return new Blames(); }