                                                                                           (wait-for-git ctx (get-in @state [:git :remote]) :ms-between-polls 100)))]
                                     (first (vals (:outputs execute-step-result)))))]
     (swap! state #(assoc % :result-channel wait-for-result-channel))
+    (wait-for-step-waiting state)
     state))
 
 (defn start-clone-step [state ref cwd]

                    (git-init)
                    (git-commit "initial commit")
                    (start-wait-for-git-step)
                    (wait-a-bit)
                    (git-commit "other commit")
                    (wait-for-step-to-complete)
                    (git-commit "commit while not waiting")

            [lambdacd.core :as lambdacd-core]
            [lambdacd.util :as util]
            [clojure.java.io :as io]
            [lambdacd-git.git :as git]
            [lambdacd.event-bus :as event-bus]))

(defn- status-updates-channel [ctx]
  (let [step-result-updates-ch (event-bus/only-payload
                                 (event-bus/subscribe ctx :step-result-updated))
        only-status-updates    (async/chan 100 (map #(get-in % [:step-result :status])))]
    (async/pipe step-result-updates-ch only-status-updates)
    only-status-updates))

(defn- init-state []
  (let [is-killed (atom false)
        ctx (some-ctx-with :is-killed is-killed)
        step-status-channel (status-updates-channel ctx)]
    (pipeline-state/start-pipeline-state-updater (:pipeline-state-component ctx) ctx)
    (atom {:ctx ctx
           :is-killed is-killed
           :step-status-channel step-status-channel})))

(defn git-init [state]
  (swap! state #(assoc % :git (git-utils/git-init)))
