Repository navigation
Conversation
shiftkey
reviewed
Oct 7, 2016
| const fields = output.split('\0') | ||
| let field: string | undefined | ||
|
|
||
| while ((field = fields.shift())) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
shiftkey
reviewed
Oct 7, 2016
| import { parsePorcelainStatus } from '../../src/lib/status-parser' | ||
|
|
||
| describe('parsePorcelainStatus', () => { | ||
| it('parses a standard status', async () => { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Member
Member
Author
|
🚈 |
joshaber
reviewed
Oct 7, 2016
| public render() { | ||
| const fileStatus = ChangedFile.mapStatus(this.props.status) | ||
| const path = this.props.status === FileStatus.Renamed && this.props.oldPath | ||
| ? `${this.props.oldPath} -> ${this.props.path}` |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Member
Author
|
🏷 |
Contributor
|
👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

I was trying out renamed files for #425 when I noticed that diffs wouldn't display. Turns out this is because
git status --porcelainoutputs a->separator between the old and new path for a rename and we were happily parsing it all straight intoFileChange.name.This switches us over to using
git status --porcelain -zso that we get null terminated fields. It also addsoldPathtoFileChangeand enables the rename icon in the changes list.With this PR we'll at least display diffs but they're not exactly accurate. Since we run
git diff --no-indexwe show a full addition diff for renames rather than just the lines that have changed. I don't have a good idea off the top of my head of how to fix that but it seems like that's out of scope for this PR anyway.