lib/vagrant-orchestrate/command/push.rb in vagrant-orchestrate-0.5.0 vs lib/vagrant-orchestrate/command/push.rb in vagrant-orchestrate-0.5.1
- old
+ new
@@ -160,20 +160,11 @@
@env.ui.warn "Vagrant-orchestrate could not gather credentials. Continuing with default credentials."
end
end
def guard_clean
- clean? && committed? || abort("ERROR!\nThere are files that need to be committed first.")
- end
-
- def clean?
- `git diff --exit-code 2>&1`
- $CHILD_STATUS == 0
- end
-
- def committed?
- `git diff-index --quiet --cached HEAD 2>&1`
- $CHILD_STATUS == 0
+ message = "ERROR!\nThere are files that need to be committed first."
+ RepoStatus.clean? && RepoStatus.committed? && !RepoStatus.untracked? || abort(message)
end
def upload_status_all(machines)
status = RepoStatus.new
source = File.join(@env.tmp_path, "vagrant_orchestrate_status")