当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript git.lib.Repository类代码示例

本文整理汇总了TypeScript中vs/workbench/parts/git/node/git.lib.Repository的典型用法代码示例。如果您正苦于以下问题:TypeScript lib.Repository类的具体用法?TypeScript lib.Repository怎么用?TypeScript lib.Repository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了lib.Repository类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

				.then(HEAD => Promise.join([this.getRepositoryRoot(), this.repo.getHeads(), this.repo.getTags(), this.repo.getRemotes()]).then(r => {
					return {
						repositoryRoot: r[0],
						status: status,
						HEAD: HEAD,
						heads: r[1],
						tags: r[2],
						remotes: r[3]
					};
				})))
开发者ID:13572293130,项目名称:vscode,代码行数:10,代码来源:rawGitService.ts

示例2:

			.then(status => this.repo.getHEAD()
				.then(HEAD => {
					if (HEAD.name) {
						return this.repo.getBranch(HEAD.name).then(null, () => HEAD);
					} else {
						return HEAD;
					}
				}, (): IRef => null)
				.then(HEAD => Promise.join([this.getRepositoryRoot(), this.repo.getRefs(), this.repo.getRemotes()]).then(r => {
					return {
						repositoryRoot: r[0],
						status: status,
						HEAD: HEAD,
						refs: r[1],
						remotes: r[2]
					};
				})))
开发者ID:amanyel,项目名称:vscode,代码行数:17,代码来源:rawGitService.ts

示例3: checkRoot

	private checkRoot(): winjs.Promise {
		if (!this.repoRealRootPath) {
			this.repoRealRootPath = pfs.realpath(this.repo.path);
		}

		return this.repo.getRoot().then(root => {
			return winjs.Promise.join([
				this.repoRealRootPath,
				pfs.realpath(root)
			]).then(paths => {
				if (!pathsAreEqual(paths[0], paths[1])) {
					return winjs.Promise.wrapError(new GitError({
						message: 'Not at the repository root',
						gitErrorCode: GitErrorCodes.NotAtRepositoryRoot
					}));
				}
			});
		});
	}
开发者ID:gaoxiaojun,项目名称:vscode,代码行数:19,代码来源:rawGitService.ts

示例4: commit

	public commit(message:string, amend?: boolean, stage?: boolean): TPromise<IRawStatus> {
		var promise: Promise = Promise.as(null);

		if (stage) {
			promise = this.repo.add(null);
		}

		return promise
			.then(() => this.repo.commit(message, stage, amend))
			.then(() => this.status());
	}
开发者ID:sangohan,项目名称:KodeStudio,代码行数:11,代码来源:rawGitService.ts

示例5:

			.then(status => this.repo.getHEAD()
				.then(HEAD => {
					if (HEAD.name) {
						return this.repo.getBranch(HEAD.name).then(null, () => HEAD);
					} else {
						return HEAD;
					}
				}, (): IHead => null)
				.then(HEAD => winjs.Promise.join([this.repo.getHeads(), this.repo.getTags()]).then(r => {
					return {
						status: status,
						HEAD: HEAD,
						heads: r[0],
						tags: r[1]
					};
				})))
开发者ID:gaoxiaojun,项目名称:vscode,代码行数:16,代码来源:rawGitService.ts

示例6: c

		return pfs.exists(path.join(this.repo.path, filePath)).then((exists) => {
			if (exists) {
				return new TPromise<string[]>((c, e) => {
					mime.detectMimesFromFile(path.join(this.repo.path, filePath), (err, result) => {
						if (err) { e(err); }
						else { c(result.mimes); }
					});
				});
			}

			var child = this.repo.show(treeish + ':' + filePath);

			return new TPromise<string[]>((c, e) => {
				mime.detectMimesFromStream(child.stdout, filePath, (err, result) => {
					if (err) { e(err); }
					else { c(result.mimes); }
				});
			});
		});
开发者ID:sangohan,项目名称:KodeStudio,代码行数:19,代码来源:rawGitService.ts

示例7:

			.then(() => this.repo.commit(message, stage, amend))
开发者ID:sangohan,项目名称:KodeStudio,代码行数:1,代码来源:rawGitService.ts

示例8: clean

	public clean(filePaths: string[]): TPromise<IRawStatus> {
		return this.repo.clean(filePaths).then(() => this.status());
	}
开发者ID:sangohan,项目名称:KodeStudio,代码行数:3,代码来源:rawGitService.ts

示例9: branch

	public branch(name: string, checkout?: boolean): TPromise<IRawStatus> {
		return this.repo.branch(name, checkout).then(() => this.status());
	}
开发者ID:sangohan,项目名称:KodeStudio,代码行数:3,代码来源:rawGitService.ts


注:本文中的vs/workbench/parts/git/node/git.lib.Repository类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。