Merge "Fixed working with git checkout depth"
diff --git a/src/com/mirantis/mk/Git.groovy b/src/com/mirantis/mk/Git.groovy
index 523a853..22ca53d 100644
--- a/src/com/mirantis/mk/Git.groovy
+++ b/src/com/mirantis/mk/Git.groovy
@@ -28,7 +28,7 @@
             doGenerateSubmoduleConfigurations: false,
             extensions: [
                 [$class: 'CheckoutOption', timeout: timeout],
-                [$class: 'CloneOption', depth: depth, noTags: false, reference: '', shallow: false, timeout: timeout]],
+                [$class: 'CloneOption', depth: depth, noTags: false, reference: '', shallow: depth > 0, timeout: timeout]],
             submoduleCfg: [],
             userRemoteConfigs: [[url: url, credentialsId: credentialsId]]]
         )