Skip to content

Commit 03baf5f

Browse files
authored
fix git check (#99)
1 parent c388eab commit 03baf5f

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,11 +932,11 @@ class BitbucketScm extends Scm {
932932

933933
// Set config
934934
command.push(
935-
'echo Setting user name and user email',
936935
trimIndentJoin([
937-
'if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ] && ! command -v git >/dev/null 2>&1; then',
936+
`if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ] && ! ${gitWrapper} "git -v" >/dev/null 2>&1; then`,
938937
` echo 'Skipping git config';`,
939938
'else',
939+
' echo "Setting user name and user email";',
940940
` ${gitWrapper} "git config user.name ${this.config.username}";`,
941941
` ${gitWrapper} "git config user.email ${this.config.email}";`,
942942
'fi'

test/data/childCommands.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "sd-checkout-code",
3-
"command": "if [ ! -z $GIT_RECURSIVE_CLONE ] && [ $GIT_RECURSIVE_CLONE = false ]; then export GIT_RECURSIVE_OPTION=\"\"; else export GIT_RECURSIVE_OPTION=\"--recursive\"; fi && if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ]; then export GIT_SPARSE_OPTION=\"--no-checkout\";else export GIT_SPARSE_OPTION=\"\"; fi && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export CONFIG_URL=git@github.com:screwdriver-cd/parent-repo; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export CONFIG_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@github.com/screwdriver-cd/parent-repo; else export CONFIG_URL=https://github.com/screwdriver-cd/parent-repo; fi; && export SD_CONFIG_DIR=$SD_ROOT_DIR/config && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch master'; else echo 'Cloning external config repo github.com/screwdriver-cd/parent-repo'; if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'master' $CONFIG_URL $SD_CONFIG_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'master' $CONFIG_URL $SD_CONFIG_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git -C $SD_CONFIG_DIR reset --hard 54321\"; echo Reset external config repo to 54321; fi && echo 'Cloning hostName/orgName/repoName, on branch branchName' && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export SCM_URL=git@hostName:orgName/repoName; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export SCM_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@hostName/orgName/repoName; else export SCM_URL=https://hostName/orgName/repoName; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch branchName'; else if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; echo 'Reset to SHA shaValue'; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git reset --hard 'shaValue'\"; fi && echo Setting user name and user email && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ] && ! command -v git >/dev/null 2>&1; then echo 'Skipping git config'; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.name sd-buildbot\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.email dev-null@screwdriver.cd\"; fi"
3+
"command": "if [ ! -z $GIT_RECURSIVE_CLONE ] && [ $GIT_RECURSIVE_CLONE = false ]; then export GIT_RECURSIVE_OPTION=\"\"; else export GIT_RECURSIVE_OPTION=\"--recursive\"; fi && if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ]; then export GIT_SPARSE_OPTION=\"--no-checkout\";else export GIT_SPARSE_OPTION=\"\"; fi && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export CONFIG_URL=git@github.com:screwdriver-cd/parent-repo; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export CONFIG_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@github.com/screwdriver-cd/parent-repo; else export CONFIG_URL=https://github.com/screwdriver-cd/parent-repo; fi; && export SD_CONFIG_DIR=$SD_ROOT_DIR/config && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch master'; else echo 'Cloning external config repo github.com/screwdriver-cd/parent-repo'; if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'master' $CONFIG_URL $SD_CONFIG_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'master' $CONFIG_URL $SD_CONFIG_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git -C $SD_CONFIG_DIR reset --hard 54321\"; echo Reset external config repo to 54321; fi && echo 'Cloning hostName/orgName/repoName, on branch branchName' && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export SCM_URL=git@hostName:orgName/repoName; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export SCM_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@hostName/orgName/repoName; else export SCM_URL=https://hostName/orgName/repoName; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch branchName'; else if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; echo 'Reset to SHA shaValue'; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git reset --hard 'shaValue'\"; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ] && ! $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git -v\" >/dev/null 2>&1; then echo 'Skipping git config'; else echo \"Setting user name and user email\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.name sd-buildbot\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.email dev-null@screwdriver.cd\"; fi"
44
}

test/data/commands.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "sd-checkout-code",
3-
"command": "if [ ! -z $GIT_RECURSIVE_CLONE ] && [ $GIT_RECURSIVE_CLONE = false ]; then export GIT_RECURSIVE_OPTION=\"\"; else export GIT_RECURSIVE_OPTION=\"--recursive\"; fi && if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ]; then export GIT_SPARSE_OPTION=\"--no-checkout\";else export GIT_SPARSE_OPTION=\"\"; fi && echo 'Cloning hostName/orgName/repoName, on branch branchName' && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export SCM_URL=git@hostName:orgName/repoName; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export SCM_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@hostName/orgName/repoName; else export SCM_URL=https://hostName/orgName/repoName; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch branchName'; else if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; echo 'Reset to SHA shaValue'; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git reset --hard 'shaValue'\"; fi && echo Setting user name and user email && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ] && ! command -v git >/dev/null 2>&1; then echo 'Skipping git config'; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.name sd-buildbot\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.email dev-null@screwdriver.cd\"; fi"
3+
"command": "if [ ! -z $GIT_RECURSIVE_CLONE ] && [ $GIT_RECURSIVE_CLONE = false ]; then export GIT_RECURSIVE_OPTION=\"\"; else export GIT_RECURSIVE_OPTION=\"--recursive\"; fi && if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ]; then export GIT_SPARSE_OPTION=\"--no-checkout\";else export GIT_SPARSE_OPTION=\"\"; fi && echo 'Cloning hostName/orgName/repoName, on branch branchName' && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export SCM_URL=git@hostName:orgName/repoName; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export SCM_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@hostName/orgName/repoName; else export SCM_URL=https://hostName/orgName/repoName; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch branchName'; else if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'branchName' $SCM_URL $SD_SOURCE_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; echo 'Reset to SHA shaValue'; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git reset --hard 'shaValue'\"; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ] && ! $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git -v\" >/dev/null 2>&1; then echo 'Skipping git config'; else echo \"Setting user name and user email\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.name sd-buildbot\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.email dev-null@screwdriver.cd\"; fi"
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "sd-checkout-code",
3-
"command": "if [ ! -z $GIT_RECURSIVE_CLONE ] && [ $GIT_RECURSIVE_CLONE = false ]; then export GIT_RECURSIVE_OPTION=\"\"; else export GIT_RECURSIVE_OPTION=\"--recursive\"; fi && if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ]; then export GIT_SPARSE_OPTION=\"--no-checkout\";else export GIT_SPARSE_OPTION=\"\"; fi && echo 'Cloning hostName/orgName/repoName, on branch commitBranch' && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export SCM_URL=git@hostName:orgName/repoName; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export SCM_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@hostName/orgName/repoName; else export SCM_URL=https://hostName/orgName/repoName; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch commitBranch'; else if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'commitBranch' $SCM_URL $SD_SOURCE_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'commitBranch' $SCM_URL $SD_SOURCE_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; echo 'Reset to SHA shaValue'; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git reset --hard 'shaValue'\"; fi && echo Setting user name and user email && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ] && ! command -v git >/dev/null 2>&1; then echo 'Skipping git config'; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.name sd-buildbot\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.email dev-null@screwdriver.cd\"; fi"
3+
"command": "if [ ! -z $GIT_RECURSIVE_CLONE ] && [ $GIT_RECURSIVE_CLONE = false ]; then export GIT_RECURSIVE_OPTION=\"\"; else export GIT_RECURSIVE_OPTION=\"--recursive\"; fi && if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ]; then export GIT_SPARSE_OPTION=\"--no-checkout\";else export GIT_SPARSE_OPTION=\"\"; fi && echo 'Cloning hostName/orgName/repoName, on branch commitBranch' && if [ ! -z $SCM_CLONE_TYPE ] && [ $SCM_CLONE_TYPE = ssh ]; then export SCM_URL=git@hostName:orgName/repoName; elif [ ! -z $SCM_USERNAME ] && [ ! -z $SCM_ACCESS_TOKEN ]; then export SCM_URL=https://$SCM_USERNAME:$SCM_ACCESS_TOKEN@hostName/orgName/repoName; else export SCM_URL=https://hostName/orgName/repoName; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ]; then echo 'Skipping cloning hostName/orgName/repoName, on branch commitBranch'; else if [ ! -z $GIT_SHALLOW_CLONE ] && [ $GIT_SHALLOW_CLONE = false ]; then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION $GIT_RECURSIVE_OPTION --quiet --progress --branch 'commitBranch' $SCM_URL $SD_SOURCE_DIR\"; else $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git clone $GIT_SPARSE_OPTION --depth=50 --no-single-branch $GIT_RECURSIVE_OPTION --quiet --progress --branch 'commitBranch' $SCM_URL $SD_SOURCE_DIR\"; fi; if [ ! -z \"$GIT_SPARSE_CHECKOUT_PATH\" ];then $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git sparse-checkout set $GIT_SPARSE_CHECKOUT_PATH\" && $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git checkout\"; fi; echo 'Reset to SHA shaValue'; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git reset --hard 'shaValue'\"; fi && if [ ! -z $SD_SKIP_REPOSITORY_CLONE ] && [ $SD_SKIP_REPOSITORY_CLONE = true ] && ! $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git -v\" >/dev/null 2>&1; then echo 'Skipping git config'; else echo \"Setting user name and user email\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.name sd-buildbot\"; $(if git --version > /dev/null 2>&1; then echo 'eval'; else echo 'sd-step exec core/git'; fi) \"git config user.email dev-null@screwdriver.cd\"; fi"
44
}

0 commit comments

Comments
 (0)