@atomist/automation-client
Version:
Atomist API for software low-level client
87 lines • 3.67 kB
TypeScript
import { ProjectOperationCredentials } from "../../operations/common/ProjectOperationCredentials";
import { RemoteRepoRef, RepoRef } from "../../operations/common/RepoId";
import { CloneOptions, DirectoryManager } from "../../spi/clone/DirectoryManager";
import { ReleaseFunction } from "../local/LocalProject";
import { NodeFsLocalProject } from "../local/NodeFsLocalProject";
import { Project } from "../Project";
import { GitProject, GitPushOptions } from "./GitProject";
import { GitStatus } from "./gitStatus";
export declare const DefaultDirectoryManager: DirectoryManager;
/**
* Implements GitProject interface using the Git binary from the command line.
* Works only if git is installed.
*/
export declare class GitCommandGitProject extends NodeFsLocalProject implements GitProject {
baseDir: string;
private readonly credentials;
provenance?: string;
static fromProject(p: Project, credentials: ProjectOperationCredentials): GitProject;
/**
* Create a project from an existing git directory
* @param {RepoRef} id
* @param {string} baseDir
* @param {ProjectOperationCredentials} credentials
* @param release call this when you're done with the project. make its filesystem resources available to others.
* @param provenance optional; for debugging, describe how this was constructed
* @return {GitCommandGitProject}
*/
static fromBaseDir(id: RepoRef, baseDir: string, credentials: ProjectOperationCredentials, release: ReleaseFunction, provenance?: string): GitCommandGitProject;
/**
* Create a new GitCommandGitProject by cloning the given remote project
* @param {ProjectOperationCredentials} credentials
* @param {RemoteRepoRef} id
* @param {CloneOptions} opts
* @param {DirectoryManager} directoryManager
* @return {Promise<GitCommandGitProject>}
*/
static cloned(credentials: ProjectOperationCredentials, id: RemoteRepoRef, opts?: CloneOptions, directoryManager?: DirectoryManager): Promise<GitProject>;
branch: string;
remote: string;
newRepo: boolean;
private constructor();
init(): Promise<this>;
isClean(): Promise<boolean>;
gitStatus(): Promise<GitStatus>;
/**
* Remote is of form https://github.com/USERNAME/REPOSITORY.git
* @param remote
*/
setRemote(remote: string): Promise<this>;
setUserConfig(user: string, email: string): Promise<this>;
createAndSetRemote(gid: RemoteRepoRef, description: string, visibility: "private" | "public"): Promise<this>;
configureFromRemote(): Promise<this>;
/**
* Raise a PR after a push to this branch
* @param title
* @param body
*/
raisePullRequest(title: string, body?: string, targetBranch?: string): Promise<this>;
/**
* `git add .` and `git commit -m MESSAGE`
* @param {string} message Commit message
* @returns {Promise<this>}
*/
commit(message: string): Promise<this>;
/**
* Check out a particular commit. We'll end in detached head state
* @param ref branch or SHA
* @return {any}
*/
checkout(ref: string): Promise<this>;
/**
* Revert all changes since last commit
* @return {any}
*/
revert(): Promise<this>;
push(options?: GitPushOptions): Promise<this>;
/**
* Create branch from current HEAD.
* @param name Name of branch to create.
* @return project object
*/
createBranch(name: string): Promise<this>;
hasBranch(name: string): Promise<boolean>;
private gitInProjectBaseDir;
}
export declare function isValidSHA1(s: string): boolean;
//# sourceMappingURL=GitCommandGitProject.d.ts.map