commit - fb0cb7081e7276c006444afb9f9decbab6bedaff
commit + d8a7bd7ded08798e7d38e6706fbc540edce788f6
blob - 928db41b2a98d23cf258b36c3c65174fb6c24ce7
blob + dbb0f4dedea82d8900cac49dd15046480d6cc5e6
--- got/got.c
+++ got/got.c
error = got_worktree_merge_in_progress(&merge_in_progress, worktree,
repo);
if (error)
+ goto done;
+
+ if (merge_in_progress && !(abort_merge || continue_merge)) {
+ error = got_error(GOT_ERR_MERGE_BUSY);
+ goto done;
+ }
+
+ if (!merge_in_progress && (abort_merge || continue_merge)) {
+ error = got_error(GOT_ERR_NOT_MERGING);
goto done;
+ }
if (abort_merge) {
- if (!merge_in_progress) {
- error = got_error(GOT_ERR_NOT_MERGING);
- goto done;
- }
error = got_worktree_merge_continue(&branch_name,
&branch_tip, &fileindex, worktree, repo);
if (error)
goto done;
if (continue_merge) {
- if (!merge_in_progress) {
- error = got_error(GOT_ERR_NOT_MERGING);
- goto done;
- }
error = got_worktree_merge_continue(&branch_name,
&branch_tip, &fileindex, worktree, repo);
if (error)
blob - 11ffa61f4a12efd380087a03aa5b186b9a745ae2
blob + df6f2f9edf54a23ff9b1e9f05267a77673a4fbcf
--- regress/cmdline/merge.sh
+++ regress/cmdline/merge.sh
fi
for cmd in update commit histedit "rebase newbranch" \
- "integrate newbranch" "stage alpha"; do
+ "integrate newbranch" "merge newbranch" "stage alpha"; do
(cd $testroot/wt && got $cmd > $testroot/stdout \
2> $testroot/stderr)
+ ret=$?
+ if [ $ret -eq 0 ]; then
+ echo "got $cmd succeeded unexpectedly" >&2
+ test_done "$testroot" "1"
+ return 1
+ fi
echo -n > $testroot/stdout.expected
cmp -s $testroot/stdout.expected $testroot/stdout