From 9f779c293e8b971569a948f5a3d1337d15837704 Mon Sep 17 00:00:00 2001 From: Yoshinori Hirano Date: Tue, 2 Jun 2020 13:37:38 +0900 Subject: [PATCH 1/4] Add 'branch' to out params - Add 'branch' to out params to specify branch dynamically - Add 'disable_single_branch' to source to support 'branch' param Signed-off-by: Yoshinori Hirano --- README.md | 7 +++++++ assets/check | 9 ++++++++- assets/in | 9 ++++++++- assets/out | 13 ++++++++++++- test/check.sh | 14 ++++++++++++++ test/get.sh | 13 +++++++++++++ test/helpers.sh | 38 ++++++++++++++++++++++++++++++++++++++ test/put.sh | 30 ++++++++++++++++++++++++++++++ 8 files changed, 130 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 35cb2511..60b13de8 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,10 @@ Tracks the commits in a [git](http://git-scm.com/) repository. *MUST* be included in commit messages for the commit to not be skipped +* `disable_single_branch`: Allows for commits that don't include in the tracked branch + to be discovered by the resource. This is *optional* basically, but it is *required* + when `branch` parameter is used in a `put` step. + ### Example Resource configuration for a private repo with an HTTPS proxy: @@ -311,6 +315,9 @@ pushed regardless of the upstream state. * `notes`: *Optional.* If this is set then notes will be added to HEAD to the `refs/notes/commits` ref. The value should be a path to a file containing the notes. +* `branch`: *Optional.* The branch to push commits. + The value should be a path to a file containing the branch. + ## Development ### Prerequisites diff --git a/assets/check b/assets/check index 8651b291..f5d52ad8 100755 --- a/assets/check +++ b/assets/check @@ -30,6 +30,7 @@ ref=$(jq -r '.version.ref // ""' < $payload) skip_ci_disabled=$(jq -r '.source.disable_ci_skip // false' < $payload) filter_whitelist=$(jq -r '.source.commit_filter.include // []' < $payload) filter_blacklist=$(jq -r '.source.commit_filter.exclude // []' < $payload) +disable_single_branch=$(jq -r '(.source.disable_single_branch // false)' < $payload) reverse=false configure_git_global "${git_config_payload}" @@ -56,7 +57,13 @@ else branchflag="--branch $branch" fi - git clone --single-branch $uri $branchflag $destination $tagflag + singleflag="--single-branch" + if [ "$disable_single_branch" == "true" ]; then + echo "Disable --single-branch git option" + singleflag="" + fi + + git clone $singleflag $uri $branchflag $destination $tagflag cd $destination fi diff --git a/assets/in b/assets/in index 786784ef..faadb729 100755 --- a/assets/in +++ b/assets/in @@ -52,6 +52,7 @@ clean_tags=$(jq -r '(.params.clean_tags // false)' < $payload) short_ref_format=$(jq -r '(.params.short_ref_format // "%s")' < $payload) timestamp_format=$(jq -r '(.params.timestamp_format // "iso8601")' < $payload) describe_ref_options=$(jq -r '(.params.describe_ref_options // "--always --dirty --broken")' < $payload) +disable_single_branch=$(jq -r '(.source.disable_single_branch // false)' < $payload) # If params not defined, get it from source if [ -z "$fetch_tags" ] || [ "$fetch_tags" == "null" ] ; then @@ -88,7 +89,13 @@ if [ "$disable_git_lfs" == "true" ]; then export GIT_LFS_SKIP_SMUDGE=1 fi -git clone --single-branch $depthflag $uri $branchflag $destination $tagflag +singleflag="--single-branch" +if [ "$disable_single_branch" == "true" ]; then + echo "Disable --single-branch git option" + singleflag="" +fi + +git clone $singleflag $depthflag $uri $branchflag $destination $tagflag cd $destination diff --git a/assets/out b/assets/out index 06999857..3854ef7c 100755 --- a/assets/out +++ b/assets/out @@ -40,6 +40,7 @@ force=$(jq -r '.params.force // false' < $payload) only_tag=$(jq -r '.params.only_tag // false' < $payload) annotation_file=$(jq -r '.params.annotate // ""' < $payload) notes_file=$(jq -r '.params.notes // ""' < $payload) +branch_file=$(jq -r '.params.branch // ""' < $payload) configure_git_global "${git_config_payload}" @@ -48,7 +49,7 @@ if [ -z "$uri" ]; then exit 1 fi -if [ -z "$branch" ] && [ "$only_tag" != "true" ]; then +if [ -z "$branch" ] && [ "$only_tag" != "true" ] && [ -z "$branch_file" ]; then echo "invalid payload (missing branch)" exit 1 fi @@ -65,6 +66,11 @@ fi cd $source +if [ -n "$branch_file" ] && [ ! -f "$branch_file" ]; then + echo "branch file '$branch_file' does not exist" + exit 1 +fi + if [ -n "$tag" ] && [ ! -f "$tag" ]; then echo "tag file '$tag' does not exist" exit 1 @@ -80,6 +86,11 @@ if [ $force = "true" ]; then forceflag="--force" fi +if [ -n "$branch_file" ]; then + branch="$(cat $branch_file)" + echo "Override branch with $branch" +fi + tag_name="" if [ -n "$tag" ]; then tag_name="$(cat $tag)" diff --git a/test/check.sh b/test/check.sh index b638a5d1..2850f5a1 100755 --- a/test/check.sh +++ b/test/check.sh @@ -26,6 +26,19 @@ it_can_check_from_head_only_fetching_single_branch() { ! git -C $cachedir rev-parse origin/bogus } +it_can_check_from_head_fetching_no_single_branch() { + local repo=$(init_repo) + local ref=$(make_commit $repo) + + local cachedir="$TMPDIR/git-resource-repo-cache" + + check_uri_with_branch_disable_single_branch $repo "master" | jq -e " + . == [{ref: $(echo $ref | jq -R .)}] + " + + git -C $cachedir rev-parse origin/bogus +} + it_fails_if_key_has_password() { local repo=$(init_repo) local ref=$(make_commit $repo) @@ -777,6 +790,7 @@ run it_can_check_with_tag_filter_over_all_branches_with_cursor run it_can_check_with_tag_filter_with_bogus_ref run it_can_check_with_tag_filter_with_replaced_tags run it_can_check_from_head_only_fetching_single_branch +run it_can_check_from_head_fetching_no_single_branch run it_can_check_and_set_git_config run it_can_check_from_a_ref_and_only_show_merge_commit run it_can_check_from_a_ref_with_paths_merged_in diff --git a/test/get.sh b/test/get.sh index a60a8e59..f2f20095 100755 --- a/test/get.sh +++ b/test/get.sh @@ -77,6 +77,18 @@ it_can_get_from_url_only_single_branch() { ! git -C $dest rev-parse origin/bogus } +it_can_get_from_url_no_single_branch() { + local repo=$(init_repo) + local ref=$(make_commit $repo) + local dest=$TMPDIR/destination + + get_uri_with_branch_disable_single_branch $repo "master" $dest | jq -e " + .version == {ref: $(echo $ref | jq -R .)} + " + + git -C $dest rev-parse origin/bogus +} + it_omits_empty_branch_in_metadata() { local repo=$(init_repo) local ref1=$(make_commit_to_branch $repo branch-a) @@ -835,6 +847,7 @@ run it_can_get_from_url run it_can_get_from_url_at_ref run it_can_get_from_url_at_branch run it_can_get_from_url_only_single_branch +run it_can_get_from_url_no_single_branch run it_omits_empty_branch_in_metadata run it_returns_branch_in_metadata run it_omits_empty_tags_in_metadata diff --git a/test/helpers.sh b/test/helpers.sh index 2266ead5..53e1c1bf 100644 --- a/test/helpers.sh +++ b/test/helpers.sh @@ -283,6 +283,16 @@ check_uri_with_branch() { }" | ${resource_dir}/check | tee /dev/stderr } +check_uri_with_branch_disable_single_branch() { + jq -n "{ + source: { + uri: $(echo $1 | jq -R .), + branch: $(echo $2 | jq -R .), + disable_single_branch: true + } + }" | ${resource_dir}/check | tee /dev/stderr +} + get_initial_ref() { local repo=$1 @@ -628,6 +638,19 @@ get_uri_with_branch() { }" | ${resource_dir}/in "$3" | tee /dev/stderr } +get_uri_with_branch_disable_single_branch() { + jq -n "{ + source: { + uri: $(echo $1 | jq -R .), + branch: $(echo $2 | jq -R .), + disable_single_branch: true + }, + params: { + short_ref_format: \"test-%s\" + } + }" | ${resource_dir}/in "$3" | tee /dev/stderr +} + get_uri_with_git_crypt_key() { local git_crypt_key_path=$(git_crypt_fixture_key_path) local git_crypt_key_base64_encoded=$(cat $git_crypt_key_path | base64) @@ -897,6 +920,21 @@ put_uri() { }" | ${resource_dir}/out "$2" | tee /dev/stderr } +put_uri_with_branch() { + jq -n "{ + source: { + uri: $(echo $1 | jq -R .), + branch: \"master\", + disable_single_branch: true + }, + params: { + repository: $(echo $3 | jq -R .), + branch: $(echo $4 | jq -R .), + rebase: true + } + }" | ${resource_dir}/out "$2" | tee /dev/stderr +} + put_uri_with_force() { jq -n "{ source: { diff --git a/test/put.sh b/test/put.sh index 5c1d3230..9749f080 100755 --- a/test/put.sh +++ b/test/put.sh @@ -31,6 +31,35 @@ it_can_put_to_url() { test "$(git -C $repo1 rev-parse some-tag)" = $ref } +it_can_put_to_url_with_branch() { + local repo1=$(init_repo) + + local src=$(mktemp -d $TMPDIR/put-src.XXXXXX) + local repo2=$src/repo + git clone $repo1 $repo2 + + local ref=$(make_commit $repo2) + + echo bogus > $src/branch-file + + # create a tag to push + git -C $repo2 tag some-tag + + # cannot push to repo while it's checked out to a branch + git -C $repo1 checkout refs/heads/master + + ! put_uri_with_branch $repo1 $src repo branch-file | jq -e " + .version == {ref: $(echo $ref | jq -R .)} + " + + # switch to bogus + git -C $repo1 checkout bogus + + test -e $repo1/some-file + ! test "$(git -C $repo1 rev-parse HEAD)" = $ref + test "$(git -C $repo1 rev-parse some-tag)" = $ref +} + it_returns_branch_in_metadata() { local repo1=$(init_repo) @@ -562,6 +591,7 @@ it_will_fail_put_with_conflicting_tag_and_not_force_push() { } run it_can_put_to_url +run it_can_put_to_url_with_branch run it_returns_branch_in_metadata run it_can_put_to_url_with_tag run it_can_put_to_url_with_tag_and_prefix From 392e9781511631fc2329be4520a3d2575e7474a9 Mon Sep 17 00:00:00 2001 From: Yoshinori Hirano Date: Mon, 28 Sep 2020 22:54:12 +0900 Subject: [PATCH 2/4] Include branch in version instead of disable_single_branch Signed-off-by: Yoshinori Hirano --- README.md | 4 ---- assets/check | 9 +-------- assets/in | 15 +++++++-------- assets/out | 21 +++++++++++++++------ test/check.sh | 14 -------------- test/get.sh | 12 +++++++----- test/helpers.sh | 27 ++++++++------------------- test/put.sh | 17 +++++++---------- 8 files changed, 45 insertions(+), 74 deletions(-) diff --git a/README.md b/README.md index 60b13de8..1ec23890 100644 --- a/README.md +++ b/README.md @@ -109,10 +109,6 @@ Tracks the commits in a [git](http://git-scm.com/) repository. *MUST* be included in commit messages for the commit to not be skipped -* `disable_single_branch`: Allows for commits that don't include in the tracked branch - to be discovered by the resource. This is *optional* basically, but it is *required* - when `branch` parameter is used in a `put` step. - ### Example Resource configuration for a private repo with an HTTPS proxy: diff --git a/assets/check b/assets/check index f5d52ad8..8651b291 100755 --- a/assets/check +++ b/assets/check @@ -30,7 +30,6 @@ ref=$(jq -r '.version.ref // ""' < $payload) skip_ci_disabled=$(jq -r '.source.disable_ci_skip // false' < $payload) filter_whitelist=$(jq -r '.source.commit_filter.include // []' < $payload) filter_blacklist=$(jq -r '.source.commit_filter.exclude // []' < $payload) -disable_single_branch=$(jq -r '(.source.disable_single_branch // false)' < $payload) reverse=false configure_git_global "${git_config_payload}" @@ -57,13 +56,7 @@ else branchflag="--branch $branch" fi - singleflag="--single-branch" - if [ "$disable_single_branch" == "true" ]; then - echo "Disable --single-branch git option" - singleflag="" - fi - - git clone $singleflag $uri $branchflag $destination $tagflag + git clone --single-branch $uri $branchflag $destination $tagflag cd $destination fi diff --git a/assets/in b/assets/in index faadb729..d3f0ebef 100755 --- a/assets/in +++ b/assets/in @@ -37,6 +37,7 @@ uri=$(jq -r '.source.uri // ""' < $payload) branch=$(jq -r '.source.branch // ""' < $payload) git_config_payload=$(jq -r '.source.git_config // []' < $payload) ref=$(jq -r '.version.ref // "HEAD"' < $payload) +override_branch=$(jq -r '.version.branch // ""' < $payload) depth=$(jq -r '(.params.depth // 0)' < $payload) fetch=$(jq -r '(.params.fetch // [])[]' < $payload) submodules=$(jq -r '(.params.submodules // "all")' < $payload) @@ -52,7 +53,6 @@ clean_tags=$(jq -r '(.params.clean_tags // false)' < $payload) short_ref_format=$(jq -r '(.params.short_ref_format // "%s")' < $payload) timestamp_format=$(jq -r '(.params.timestamp_format // "iso8601")' < $payload) describe_ref_options=$(jq -r '(.params.describe_ref_options // "--always --dirty --broken")' < $payload) -disable_single_branch=$(jq -r '(.source.disable_single_branch // false)' < $payload) # If params not defined, get it from source if [ -z "$fetch_tags" ] || [ "$fetch_tags" == "null" ] ; then @@ -72,6 +72,11 @@ if [ -n "$branch" ]; then branchflag="--branch $branch" fi +if [ -n "$override_branch" ]; then + echo "Override $branch with $override_branch" + branchflag="--branch $override_branch" +fi + depthflag="" if test "$depth" -gt 0 2> /dev/null; then depthflag="--depth $depth" @@ -89,13 +94,7 @@ if [ "$disable_git_lfs" == "true" ]; then export GIT_LFS_SKIP_SMUDGE=1 fi -singleflag="--single-branch" -if [ "$disable_single_branch" == "true" ]; then - echo "Disable --single-branch git option" - singleflag="" -fi - -git clone $singleflag $depthflag $uri $branchflag $destination $tagflag +git clone --single-branch $depthflag $uri $branchflag $destination $tagflag cd $destination diff --git a/assets/out b/assets/out index 3854ef7c..8b1b229f 100755 --- a/assets/out +++ b/assets/out @@ -86,9 +86,11 @@ if [ $force = "true" ]; then forceflag="--force" fi +override_branch="" if [ -n "$branch_file" ]; then - branch="$(cat $branch_file)" - echo "Override branch with $branch" + override_branch="$(cat $branch_file)" + echo "Override $branch with $override_branch" + branch=$override_branch fi tag_name="" @@ -214,7 +216,14 @@ else version_ref="$(git rev-parse HEAD | jq -R .)" fi -jq -n "{ - version: {ref: $version_ref}, - metadata: $(git_metadata) -}" >&3 +if [ -n "$override_branch" ]; then + jq -n "{ + version: {branch: $(echo $override_branch | jq -R .), ref: $version_ref}, + metadata: $(git_metadata) + }" >&3 +else + jq -n "{ + version: {ref: $version_ref}, + metadata: $(git_metadata) + }" >&3 +fi diff --git a/test/check.sh b/test/check.sh index 2850f5a1..b638a5d1 100755 --- a/test/check.sh +++ b/test/check.sh @@ -26,19 +26,6 @@ it_can_check_from_head_only_fetching_single_branch() { ! git -C $cachedir rev-parse origin/bogus } -it_can_check_from_head_fetching_no_single_branch() { - local repo=$(init_repo) - local ref=$(make_commit $repo) - - local cachedir="$TMPDIR/git-resource-repo-cache" - - check_uri_with_branch_disable_single_branch $repo "master" | jq -e " - . == [{ref: $(echo $ref | jq -R .)}] - " - - git -C $cachedir rev-parse origin/bogus -} - it_fails_if_key_has_password() { local repo=$(init_repo) local ref=$(make_commit $repo) @@ -790,7 +777,6 @@ run it_can_check_with_tag_filter_over_all_branches_with_cursor run it_can_check_with_tag_filter_with_bogus_ref run it_can_check_with_tag_filter_with_replaced_tags run it_can_check_from_head_only_fetching_single_branch -run it_can_check_from_head_fetching_no_single_branch run it_can_check_and_set_git_config run it_can_check_from_a_ref_and_only_show_merge_commit run it_can_check_from_a_ref_with_paths_merged_in diff --git a/test/get.sh b/test/get.sh index f2f20095..c40ef4fb 100755 --- a/test/get.sh +++ b/test/get.sh @@ -77,16 +77,18 @@ it_can_get_from_url_only_single_branch() { ! git -C $dest rev-parse origin/bogus } -it_can_get_from_url_no_single_branch() { +it_can_get_from_url_at_override_branch() { local repo=$(init_repo) - local ref=$(make_commit $repo) + local branch="branch-a" + local ref=$(make_commit_to_branch $repo $branch) local dest=$TMPDIR/destination - get_uri_with_branch_disable_single_branch $repo "master" $dest | jq -e " + get_uri_with_override_branch $repo $branch $ref $dest | jq -e " .version == {ref: $(echo $ref | jq -R .)} " - git -C $dest rev-parse origin/bogus + test -e $dest/some-file + test "$(git -C $dest rev-parse HEAD)" = $ref } it_omits_empty_branch_in_metadata() { @@ -847,7 +849,7 @@ run it_can_get_from_url run it_can_get_from_url_at_ref run it_can_get_from_url_at_branch run it_can_get_from_url_only_single_branch -run it_can_get_from_url_no_single_branch +run it_can_get_from_url_at_override_branch run it_omits_empty_branch_in_metadata run it_returns_branch_in_metadata run it_omits_empty_tags_in_metadata diff --git a/test/helpers.sh b/test/helpers.sh index 53e1c1bf..fc60f4ba 100644 --- a/test/helpers.sh +++ b/test/helpers.sh @@ -283,16 +283,6 @@ check_uri_with_branch() { }" | ${resource_dir}/check | tee /dev/stderr } -check_uri_with_branch_disable_single_branch() { - jq -n "{ - source: { - uri: $(echo $1 | jq -R .), - branch: $(echo $2 | jq -R .), - disable_single_branch: true - } - }" | ${resource_dir}/check | tee /dev/stderr -} - get_initial_ref() { local repo=$1 @@ -638,17 +628,19 @@ get_uri_with_branch() { }" | ${resource_dir}/in "$3" | tee /dev/stderr } -get_uri_with_branch_disable_single_branch() { +get_uri_with_override_branch() { jq -n "{ source: { - uri: $(echo $1 | jq -R .), - branch: $(echo $2 | jq -R .), - disable_single_branch: true + uri: $(echo $1 | jq -R .) }, params: { short_ref_format: \"test-%s\" + }, + version: { + branch: $(echo $2 | jq -R .), + ref: $(echo $3 | jq -R .) } - }" | ${resource_dir}/in "$3" | tee /dev/stderr + }" | ${resource_dir}/in "$4" | tee /dev/stderr } get_uri_with_git_crypt_key() { @@ -923,14 +915,11 @@ put_uri() { put_uri_with_branch() { jq -n "{ source: { - uri: $(echo $1 | jq -R .), - branch: \"master\", - disable_single_branch: true + uri: $(echo $1 | jq -R .) }, params: { repository: $(echo $3 | jq -R .), branch: $(echo $4 | jq -R .), - rebase: true } }" | ${resource_dir}/out "$2" | tee /dev/stderr } diff --git a/test/put.sh b/test/put.sh index 9749f080..a138baaa 100755 --- a/test/put.sh +++ b/test/put.sh @@ -38,26 +38,23 @@ it_can_put_to_url_with_branch() { local repo2=$src/repo git clone $repo1 $repo2 - local ref=$(make_commit $repo2) - - echo bogus > $src/branch-file + local branch="branch-a" + local ref=$(make_commit_to_branch $repo2 $branch) - # create a tag to push - git -C $repo2 tag some-tag + echo $branch > $src/branch-file # cannot push to repo while it's checked out to a branch git -C $repo1 checkout refs/heads/master ! put_uri_with_branch $repo1 $src repo branch-file | jq -e " - .version == {ref: $(echo $ref | jq -R .)} + .version == {branch: $(echo $branch | jq -R .), ref: $(echo $ref | jq -R .)} " - # switch to bogus - git -C $repo1 checkout bogus + # switch to branch-a + git -C $repo1 checkout $branch test -e $repo1/some-file - ! test "$(git -C $repo1 rev-parse HEAD)" = $ref - test "$(git -C $repo1 rev-parse some-tag)" = $ref + test "$(git -C $repo1 rev-parse HEAD)" = $ref } it_returns_branch_in_metadata() { From 020f2a10fa99d06a564c49b15dcbed6b66e1bc20 Mon Sep 17 00:00:00 2001 From: Yoshinori Hirano Date: Wed, 30 Sep 2020 17:50:15 +0900 Subject: [PATCH 3/4] Move away from param that takes a file Signed-off-by: Yoshinori Hirano --- README.md | 1 - assets/out | 13 +++---------- test/put.sh | 4 +--- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 1ec23890..056936e2 100644 --- a/README.md +++ b/README.md @@ -312,7 +312,6 @@ pushed regardless of the upstream state. `refs/notes/commits` ref. The value should be a path to a file containing the notes. * `branch`: *Optional.* The branch to push commits. - The value should be a path to a file containing the branch. ## Development diff --git a/assets/out b/assets/out index 8b1b229f..fbc1564b 100755 --- a/assets/out +++ b/assets/out @@ -40,7 +40,7 @@ force=$(jq -r '.params.force // false' < $payload) only_tag=$(jq -r '.params.only_tag // false' < $payload) annotation_file=$(jq -r '.params.annotate // ""' < $payload) notes_file=$(jq -r '.params.notes // ""' < $payload) -branch_file=$(jq -r '.params.branch // ""' < $payload) +override_branch=$(jq -r '.params.branch // ""' < $payload) configure_git_global "${git_config_payload}" @@ -49,7 +49,7 @@ if [ -z "$uri" ]; then exit 1 fi -if [ -z "$branch" ] && [ "$only_tag" != "true" ] && [ -z "$branch_file" ]; then +if [ -z "$branch" ] && [ "$only_tag" != "true" ] && [ -z "$override_branch" ]; then echo "invalid payload (missing branch)" exit 1 fi @@ -66,11 +66,6 @@ fi cd $source -if [ -n "$branch_file" ] && [ ! -f "$branch_file" ]; then - echo "branch file '$branch_file' does not exist" - exit 1 -fi - if [ -n "$tag" ] && [ ! -f "$tag" ]; then echo "tag file '$tag' does not exist" exit 1 @@ -86,9 +81,7 @@ if [ $force = "true" ]; then forceflag="--force" fi -override_branch="" -if [ -n "$branch_file" ]; then - override_branch="$(cat $branch_file)" +if [ -n "$override_branch" ]; then echo "Override $branch with $override_branch" branch=$override_branch fi diff --git a/test/put.sh b/test/put.sh index a138baaa..8e13ecbf 100755 --- a/test/put.sh +++ b/test/put.sh @@ -41,12 +41,10 @@ it_can_put_to_url_with_branch() { local branch="branch-a" local ref=$(make_commit_to_branch $repo2 $branch) - echo $branch > $src/branch-file - # cannot push to repo while it's checked out to a branch git -C $repo1 checkout refs/heads/master - ! put_uri_with_branch $repo1 $src repo branch-file | jq -e " + put_uri_with_branch $repo1 $src repo $branch | jq -e " .version == {branch: $(echo $branch | jq -R .), ref: $(echo $ref | jq -R .)} " From 504a3aa5ba5c1424fb5c42d232236ad81b841f9c Mon Sep 17 00:00:00 2001 From: Yoshinori Hirano Date: Fri, 2 Oct 2020 18:54:47 +0900 Subject: [PATCH 4/4] Add notes about 'branch' param in README Signed-off-by: Yoshinori Hirano --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 056936e2..6f2b50f9 100644 --- a/README.md +++ b/README.md @@ -313,6 +313,10 @@ pushed regardless of the upstream state. * `branch`: *Optional.* The branch to push commits. + Note that the version produced by the `put` step will be picked up by subsequent `get` steps + even if the `branch` differs from the `branch` specified in the source. + To avoid this, you should use two resources of read-only and write-only. + ## Development ### Prerequisites