in spec/lib/gdk/project/git_worktree_spec.rb [200:214]
def expect_auto_rebase(rebase_success = true)
expect_shellout('git branch --show-current', stdout: current_branch_name)
expect_shellout("git rev-parse --abbrev-ref #{default_branch}@{upstream}", stdout: ref_remote_branch)
stderr = rebase_success ? '' : 'rebase failed'
expect_shellout("git rebase #{ref_remote_branch} -s recursive -X ours --no-rerere-autoupdate", success: rebase_success, stderr: stderr)
expect_shellout('git rebase --abort', args: { display_output: false }) unless rebase_success
if rebase_success
expect(GDK::Output).to receive(:success).with("Successfully fetched and rebased '#{default_branch}' on '#{current_branch_name}' for '#{short_worktree_path}'")
else
expect(GDK::Output).to receive(:puts).with(stderr, stderr: true)
expect(GDK::Output).to receive(:error).with("Failed to rebase '#{default_branch}' on '#{current_branch_name}' for '#{short_worktree_path}'", stderr)
end
end