Commits


update the base commit ID of unmodified files if the blob ID matches This avoids having to run 'got update' after operations which run checkout_files() and where a file happens to have the same blob ID but its base commit differs from the commit we are updating to. Found while investigating a bug report by naddy@ ok op, jamsek (earlier version)


add test case for 'got update' changing a directory into a file


handle files changing into directories during 'got update' problem found by naddy@


regress: replace "sed -i" with ed(1) for portable in-place editing "sed -i" is fundamentally unportable. GNU and OpenBSD sed(1) treat the extension for the backup file as an optional argument and use "sed -i" for no backup file. FreeBSD sed(1) treats the extension as an obligatory argument and uses "sed -i ''" for no backup file. There is no single syntax that works for both. ok stsp op


regress: replace unportable ln -h option with rm && ln ok stsp


add xfail test for "got update" replacing a file with a directory ok stsp


regress: git_rm will cd into the test repo by itself


optimise parsing of modified files for conflict markers As per stsp's original design for detecting new conflicts, rather than produce a diff formatted for human consumption, parse the raw diff result to scan only newly added lines for conflict markers. While here, fix a couple related bugs in the original implementation: (1) rewind the versioned file blob so we don't end up with an empty "from" (i.e., LHS of the diff) file; and (2) force an ASCII text diff for so we don't miss conflicts in binary files. ok stsp@


add ci/he/mg/rb -C option to commit unresolved conflicts As per stsp's suggestion and building on his initial diff, add the -C option to enable creating commits with unresolved conflicts to the commit, histedit, merge, and rebase commands to allow continuing the operation despite files in conflict status. Also, only search for conflict markers in newly added lines to enable working with files already under version control that may have conflict markers embedded verbatim. lots of tweaks, improvements, and initial diff + ok stsp@


respect umask when creating or changing files and directories This behaviour is already documented in got-worktree(5) but wasn't actually implemented. ok stsp@


fix regression test failures with Git 3.30.5 / 2.38.1 or later installed The fix for CVE-2022-39253 in Git made our regression tests fail since creating submodules from local clones is no longer allowed by default. Add an override to our invocations of "git submodule add", the same which was added to Git's regression test suite as part of their fix. This CVE doesn't otherwise affect us. We do not implement submodules. Our use of them in regression tests exists only to ensure that Got does not freak out when it sees one. Precisely because automated support for nested repositories and/or working copies (as in Git Submodules, or Subversion Externals, etc.) have been an endless source of security problems in other systems. sudden test failures pointed out by naddy@


always show commit or tree IDs in diff header, in order to help 'got patch' The idea is that got patch can simply look for a line such as: commit - abcde1234567... to find the merge base commit ID to show in diff3 conflict markers. got log -p now displays commit IDs in its diff header, instead ofl tree or blob IDs. ok op@


set `ret' in a few places where it was forgotten; ok tracey@


use test(1) -eq and -ne to compare integers, and reduce quoting This brings the rest of the regression test scripts in line with patch.sh.


preverse binary files during updates and merges