diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index d559bb36cc6..0ced42c7eac 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -447,7 +447,7 @@ export class GitStatusParser { // space i++; - if (entry.x === 'R') { + if (entry.x === 'R' || entry.x === 'C') { lastIndex = raw.indexOf('\0', i); if (lastIndex === -1) { diff --git a/extensions/git/src/model.ts b/extensions/git/src/model.ts index 25e9c6bcad7..3c9496cfd02 100644 --- a/extensions/git/src/model.ts +++ b/extensions/git/src/model.ts @@ -53,7 +53,7 @@ export class Resource implements SourceControlResourceState { @memoize get resourceUri(): Uri { - if (this.renameResourceUri && (this._type === Status.MODIFIED || this._type === Status.DELETED || this._type === Status.INDEX_RENAMED)) { + if (this.renameResourceUri && (this._type === Status.MODIFIED || this._type === Status.DELETED || this._type === Status.INDEX_RENAMED || this._type === Status.INDEX_COPIED)) { return this.renameResourceUri; } @@ -712,7 +712,7 @@ export class Model implements Disposable { case 'A': index.push(new Resource(this.workspaceRoot, this.indexGroup, uri, Status.INDEX_ADDED)); break; case 'D': index.push(new Resource(this.workspaceRoot, this.indexGroup, uri, Status.INDEX_DELETED)); break; case 'R': index.push(new Resource(this.workspaceRoot, this.indexGroup, uri, Status.INDEX_RENAMED, renameUri)); break; - case 'C': index.push(new Resource(this.workspaceRoot, this.indexGroup, uri, Status.INDEX_COPIED)); break; + case 'C': index.push(new Resource(this.workspaceRoot, this.indexGroup, uri, Status.INDEX_COPIED, renameUri)); break; } switch (raw.y) {