Skip to content

Fix uncommitted code error.#303

Merged
justin808 merged 1 commit intoshakacode:masterfrom
nmatyukov:fix-git-uncommitted-error
Mar 7, 2016
Merged

Fix uncommitted code error.#303
justin808 merged 1 commit intoshakacode:masterfrom
nmatyukov:fix-git-uncommitted-error

Conversation

@nmatyukov
Copy link
Copy Markdown
Contributor

When I tried to install react_on_rails, I got "ERROR: You have uncommitted code. Please commit or stash your changes before continuing." but all of my code were committed.

The problem was in the git localization: "нечего фиксировать, рабочая директория пуста" instead of "nothing to commit, working directory clean" (but both are the same).

Here is the fix that checks on empty git status if no uncommitted changes.

Review on Reviewable

def self.uncommitted_changes?(message_handler)
return false if ENV["COVERAGE"]
status = `git status`
return false if status.include?("nothing to commit, working directory clean")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmatyukov Sweet!
@robwise CC

@justin808
Copy link
Copy Markdown
Member

:lgtm: Thanks!


Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from the review on Reviewable.io

@justin808
Copy link
Copy Markdown
Member

@nmatyukov Can you please rebase this on top of master. Then I'll have the auto-merge button.

@nmatyukov nmatyukov force-pushed the fix-git-uncommitted-error branch from ec4e673 to b62c255 Compare March 7, 2016 04:32
@nmatyukov
Copy link
Copy Markdown
Contributor Author

@justin808 Branch was rebased.

justin808 added a commit that referenced this pull request Mar 7, 2016
@justin808 justin808 merged commit 08fe39b into shakacode:master Mar 7, 2016
@justin808
Copy link
Copy Markdown
Member

Thanks @nmatyukov!

@nmatyukov nmatyukov deleted the fix-git-uncommitted-error branch March 7, 2016 14:18
return false if ENV["COVERAGE"]
status = `git status`
return false if status.include?("nothing to commit, working directory clean")
status = `git status --porcelain`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not work if I have untracked files

$ git status --porcelain
?? .byebug_history
?? .gitignore
?? .idea/
?? .rspec
?? .rubocop.yml
?? .ruby-gemset
?? .ruby-version

AbanoubGhadban pushed a commit that referenced this pull request Sep 25, 2025
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AbanoubGhadban pushed a commit that referenced this pull request Sep 26, 2025
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

3 participants