git: multi repo stage

This commit is contained in:
Joao Moreno
2017-08-15 16:19:44 +02:00
parent 76cfa5d796
commit b95a585df9
2 changed files with 14 additions and 4 deletions

View File

@@ -297,6 +297,7 @@ export interface CommitOptions {
export interface IRepository {
add(resources: Uri[]): Promise<void>;
stage(resource: Uri, contents: string): Promise<void>;
}
export class Repository implements IRepository, Disposable {
@@ -406,8 +407,8 @@ export class Repository implements IRepository, Disposable {
await this.run(Operation.Add, () => this.repository.add(resources.map(r => r.fsPath)));
}
async stage(uri: Uri, contents: string): Promise<void> {
const relativePath = path.relative(this.repository.root, uri.fsPath).replace(/\\/g, '/');
async stage(resource: Uri, contents: string): Promise<void> {
const relativePath = path.relative(this.repository.root, resource.fsPath).replace(/\\/g, '/');
await this.run(Operation.Stage, () => this.repository.stage(relativePath, contents));
}