本文整理汇总了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]
};
})))
示例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]
};
})))
示例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
}));
}
});
});
}
示例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());
}
示例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]
};
})))
示例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); }
});
});
});
示例7:
.then(() => this.repo.commit(message, stage, amend))
示例8: clean
public clean(filePaths: string[]): TPromise<IRawStatus> {
return this.repo.clean(filePaths).then(() => this.status());
}
示例9: branch
public branch(name: string, checkout?: boolean): TPromise<IRawStatus> {
return this.repo.branch(name, checkout).then(() => this.status());
}