Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StatusSummary and FileStatusSummary bugfix #1019

Closed

Conversation

mark-codesphere
Copy link
Contributor

Git status is called with the --null flag. This flag as well as -z changes the format of git status:
https://www.git-scm.com/docs/git-config/2.19.0#Documentation/git-config.txt--z
https://git-scm.com/docs/git-status#Documentation/git-status.txt--z

FileStatusSummary constructor has a bug with renames that is related to this commit. The arrow is not printed inside the status, it is necessary to split with \0.

It seems unnecessary to me to delete \0 before constructor inside StatusSummary.ts. But I might be wrong.

The following code:

await git.add('file');
await git.commit('initial');
await git.mv('file', 'copy');
await git.add('copy');

caused this status before:

...
  "renamed": [
    {
      "from": "file",
      "to": "copy"
    }
  ],
  "files": [
    {
      "path": "copy",
      "index": "R",
      "working_dir": " "
    }
  ],
...

and this status after:

...
  "renamed": [
    {
      "from": "file",
      "to": "copy"
    }
  ],
  "files": [
    {
      "path": "copy",
      "index": "R",
      "working_dir": " ",
      "from": "file"
    }
  ],
...

Copy link

changeset-bot bot commented Sep 9, 2024

⚠️ No Changeset found

Latest commit: 7ce5645

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@steveukx steveukx mentioned this pull request Sep 14, 2024
@steveukx
Copy link
Owner

Thank you for the pull request, looks good to me. I'll add a test and changeset & have a new version out in the next couple of days.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants