Commits


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@


show file mode for new added files in work tree diffs Make work tree diffs of local changes on disk display the file mode of new added files like other versions of `got diff` currently do. ok stsp@


wrap overlong line in diff.sh


got: fix typo in argc check when diffing two blobs We already have two arguments when diffing two blobs, so check for more than two like we do when diffing two objects to check for invalid path args. Includes new regress test by op for diffing two blobs. ok stsp@ and ok plus regress test from op@


add a simple test for 'got diff' against CRLF files


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@


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.


new test: `got diff' on files matched by an ignore pattern


regress: make test operands POSIX compliant Since the interpreter for the regress shell scripts are using /bin/sh this will usually imply some level of POSIX compliance (that isn't bash-specific, for instance). Some systems use dash as their sh shell and as such is stricter POSIX compliance. To help -portable, make the shell test checks use a single '=' for equality, rather than '=='.


sort and de-duplicate work tree path command line arguments This is important in cases like 'got diff file.txt file.txt' which should only show the diff for file.txt once. suggested by kn@


implement 'got diff -c' for diffing commits with optional filtering by path Need for filtering by path sugggested by kn@ ok naddy@


add support for multiple path arguments to 'got diff' positive feedback from Omar and kn ok kn


make 'got update' display the worktree's branch name upon success ok tracey


use POSIX [s1 = s2] syntax instead of [s1 == s2]; patch by Ryo ONODERA


replace echo with printf, stop option processing with "--" for portability ok stsp