make 'got merge' interrupt the merge upon undeleted and unversioned files
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
diff --git a/got/got.c b/got/got.c
index 46e4398..5aa3eb4 100644
--- a/got/got.c
+++ b/got/got.c
@@ -10824,24 +10824,26 @@ cmd_merge(int argc, char *argv[])
if (error)
goto done;
printf("Merge of %s interrupted on request\n", branch_name);
- } else if (upa.conflicts > 0 || upa.missing > 0) {
+ } else if (upa.conflicts > 0 || upa.missing > 0 ||
+ upa.not_deleted > 0 || upa.unversioned > 0) {
error = got_worktree_merge_postpone(worktree, fileindex);
if (error)
goto done;
- if (upa.conflicts > 0 && upa.missing == 0) {
+ if (upa.conflicts > 0 && upa.missing == 0 &&
+ upa.not_deleted == 0 && upa.unversioned == 0) {
error = got_error_msg(GOT_ERR_CONFLICTS,
"conflicts must be resolved before merging "
"can continue");
} else if (upa.conflicts > 0) {
error = got_error_msg(GOT_ERR_CONFLICTS,
"conflicts must be resolved before merging "
- "can continue; changes destined for missing "
+ "can continue; changes destined for some "
"files were not yet merged and "
"should be merged manually if required before the "
"merge operation is continued");
} else {
error = got_error_msg(GOT_ERR_CONFLICTS,
- "changes destined for missing "
+ "changes destined for some "
"files were not yet merged and should be "
"merged manually if required before the "
"merge operation is continued");
diff --git a/regress/cmdline/merge.sh b/regress/cmdline/merge.sh
index 9ccf58a..be7e587 100755
--- a/regress/cmdline/merge.sh
+++ b/regress/cmdline/merge.sh
@@ -997,7 +997,7 @@ test_merge_missing_file() {
return 1
fi
- echo -n "got: changes destined for missing files " \
+ echo -n "got: changes destined for some files " \
> $testroot/stderr.expected
echo -n "were not yet merged and should be merged manually if " \
>> $testroot/stderr.expected