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

Fix uncommitted code error. #303

Merged
merged 1 commit into from
Mar 7, 2016

Conversation

nmatyukov
Copy link
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

@@ -2,8 +2,8 @@ module ReactOnRails
module GitUtils
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
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
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
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
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
Member

Thanks @nmatyukov!

@nmatyukov nmatyukov deleted the fix-git-uncommitted-error branch March 7, 2016 14:18
@@ -2,8 +2,8 @@ module ReactOnRails
module GitUtils
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")
status = `git status --porcelain`

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

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