commit 88d249c247d1925b032b3d0b1ce8cac6aa7d1a6d from: Stefan Sperling via: Thomas Adam date: Fri Sep 24 22:01:09 2021 UTC stop caring about obstructed versioned files in 'got merge' Tyring to write a test to cover this case I found that obstructed files are (correctly) detected as local modifications in the work tree. Thus they trigger the pre-condition check for local modications and 'got merge' will not even start to do any work in the presence of obstructed files. commit - dfe86d1fa6f81d3a709059eda591863efd8d5a34 commit + 88d249c247d1925b032b3d0b1ce8cac6aa7d1a6d blob - 55846aa7e98871dabc52f2ac079d93817150bc11 blob + ad59381b01b718149650684acc9d252cdfdf08dc --- got/got.1 +++ got/got.1 @@ -2179,7 +2179,7 @@ using the following status codes: .Pp If merge conflicts occur, the merge operation is interrupted and conflicts must be resolved before the merge operation can continue. -If any files with destined changes are found to be missing or obstructed, +If any files with destined changes are found to be missing, the merge operation will be interrupted to prevent potentially incomplete changes from being committed to the repository without user intervention. The work tree may be modified as desired and the merge can be continued blob - 68051b649756089f26c38a6069faddb38304f590 blob + c4e5c1824c875392b7ef1495c9256b3f8f5c84d6 --- got/got.c +++ got/got.c @@ -10776,12 +10776,11 @@ cmd_merge(int argc, char *argv[]) print_update_progress_stats(&upa); } - if (upa.conflicts > 0 || upa.obstructed > 0 || upa.missing > 0) { + if (upa.conflicts > 0 || upa.missing > 0) { error = got_worktree_merge_postpone(worktree, fileindex); if (error) goto done; - if (upa.conflicts > 0 && - upa.obstructed == 0 && upa.missing == 0) { + if (upa.conflicts > 0 && upa.missing == 0) { error = got_error_msg(GOT_ERR_CONFLICTS, "conflicts must be resolved before merging " "can continue"); @@ -10789,12 +10788,12 @@ cmd_merge(int argc, char *argv[]) error = got_error_msg(GOT_ERR_CONFLICTS, "conflicts must be resolved before merging " "can continue; changes destined for missing " - "or obstructed files were not yet merged and " + "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 or obstructed " + "changes destined for missing " "files were not yet merged and should be " "merged manually if required before the " "merge operation is continued"); blob - 67bc1f72b89233ad2c07f094e83e1ff44af5871c blob + 0e1a94a8ea7156a29ef18ee63b4b1d881a0b6d30 --- regress/cmdline/merge.sh +++ regress/cmdline/merge.sh @@ -942,7 +942,7 @@ test_merge_missing_file() { return 1 fi - echo -n "got: changes destined for missing or obstructed files " \ + echo -n "got: changes destined for missing files " \ > $testroot/stderr.expected echo -n "were not yet merged and should be merged manually if " \ >> $testroot/stderr.expected