From cae605d21b38c47f4e37730d33a1138050737737 Mon Sep 17 00:00:00 2001
From: Matthias Beyer <mail@beyermatthias.de>
Date: Sun, 18 Sep 2016 18:51:15 +0200
Subject: [PATCH] Runtime::ensure_cfg_branch_is_checked_out() should check
 whether config enforces this

---
 libimagstorestdhook/src/vcs/git/runtime.rs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libimagstorestdhook/src/vcs/git/runtime.rs b/libimagstorestdhook/src/vcs/git/runtime.rs
index a306c83c..45ffa29a 100644
--- a/libimagstorestdhook/src/vcs/git/runtime.rs
+++ b/libimagstorestdhook/src/vcs/git/runtime.rs
@@ -91,6 +91,11 @@ impl Runtime {
     /// Ensure that the branch that is put in the configuration file is checked out, if any.
     pub fn ensure_cfg_branch_is_checked_out(&self, action: &StoreAction) -> HookResult<()> {
         use vcs::git::config::ensure_branch;
+        use vcs::git::config::do_checkout_ensure_branch;
+
+        if !do_checkout_ensure_branch(self.config.as_ref()) {
+            return Ok(())
+        }
 
         debug!("[GIT {} HOOK]: Ensuring branch checkout", action.uppercase());
         let head = try!(self