當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。