Skip to content

Commit 2cc3f9c

Browse files
Xin Zhangkarthijrk
Xin Zhang
authored andcommitted
WIP: used fixed directory pr_temp_branch to get around the master branch issue
Signed-off-by: Karthikeyan Jambu Rajaraman <[email protected]>
1 parent 21b78c2 commit 2cc3f9c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Diff for: assets/lib/in.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ def ref
1919

2020
pr = Octokit.pull_request(input['source']['repo'], input['version']['pr'])
2121
id = pr['number']
22-
branch_ref = pr['head']['sha']
22+
branch_ref = pr['head']['ref']
2323

2424
system("git clone --depth 1 #{uri} #{destination} 1>&2")
2525

2626
raise 'git clone failed' unless $CHILD_STATUS.exitstatus == 0
2727

2828
Dir.chdir(destination) do
29-
system("git fetch -q origin pull/#{id}/head:#{branch_ref} 1>&2")
30-
system("git checkout #{branch_ref} 1>&2")
29+
system("git fetch -q origin pull/#{id}/head:pr_temp_branch 1>&2")
30+
system("git checkout pr_temp_branch 1>&2")
3131
system("git config --add pullrequest.url #{pr['html_url']} 1>&2")
3232
system("git config --add pullrequest.id #{pr['number']} 1>&2")
33-
system("git config --add pullrequest.branch #{branch_ref} 1>&2")
33+
system("git config --add pullrequest.branch pr_temp_branch 1>&2")
3434
end
3535

3636
puts JSON.generate(version: { ref: ref, pr: id.to_s },

Diff for: spec/integration/in_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ def commit(msg)
5656
get(version: { ref: @ref, pr: '1' }, source: { uri: git_uri, repo: 'jtarchie/test' })
5757

5858
value = git('rev-parse --abbrev-ref HEAD', dest_dir)
59-
expect(value).to eq 'foo'
59+
expect(value).to eq 'pr_temp_branch'
6060
end
6161

6262
it 'sets config variable to branch name' do
6363
get(version: { ref: @ref, pr: '1' }, source: { uri: git_uri, repo: 'jtarchie/test' })
6464
value = git('config pullrequest.branch', dest_dir)
65-
expect(value).to eq 'foo'
65+
expect(value).to eq 'pr_temp_branch'
6666
end
6767

6868
context 'when the git clone fails' do

0 commit comments

Comments
 (0)