9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/learn_test/git_wip.rb', line 9
def run!(log: false)
git = Git.open('./', log: log)
working_branch = git.current_branch
commands = [
'learn-test-wip save "Automatic test submission" --editor',
"git push origin wip/#{working_branch}:refs/heads/wip"
].join(';')
Open3.popen3(commands) do |_stdin, _stdout, _stderr, wait_thr|
if wait_thr.value.exitstatus.zero?
git.config['remote.origin.url'].gsub('.git', '/tree/wip')
else
false
end
end
rescue StandardError => e
false
end
|