Commits


make 'got merge -c' fail even if new changes only affect unrelated paths Otherwise, 'got merge -c' can silently revert already committed changes. Also fix GOT_ERR_MERGE_COMMIT_OUT_OF_DATE by giving it a value distinct from GOT_ERR_MERGE_STAGED_PATHS. Patch by James Cook


only delete empty directories appearing in arguments to 'got rm' Make 'got rm' keep empty directories which are not explicitly listed for deletion. Deleting such directories is problematic in several use cases. Avoids deleting the current working directory when the user runs "got rm *" (pointed out by Mikhail), and avoids deletion of an empty directory "foo/" after 'got rm foo/a foo/b' (pointed out by op@). ok jamsek, op


allow no-op merge commits to be created Requested by James Cook


fix 'got commit' using a bad parent commit ID when worktree is out-of-date Problem reported by James Cook with reproduction scripts Regression test case by jamsek, as a simplified version of James' scripts fix tested + ok jamsek


when aborting rebase/histedit/merge, unlink files added by merged changes Otherwise we leave unversioned files behind in the work tree which may interfere with new attempts to rebase or merge the changes again. Problem found by + ok naddy@


style nits from op@, thanks!


make 'got revert' and 'got rm' work on non-existent directories problem found by robert@ ok jamsek, op


fix rebase/histedit -a leaving some files on the temporary branch The commands 'got rebase -a' and 'got histedit -a' were checking out files from the wrong commit. Make them check files out from the commit we are switching the work tree to, as intended. Avoids spurious merge conflicts when the work tree is later used for another rebase operation. It also makes 'got update' right after 'rebase -a' a no-op, as it should be. Problem found by naddy@ while rebasing jca's llvm15 branch ok op, jamsek earlier version


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)


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


support histedit fold operations which delete a file and then add it again problem found by naddy@ ok op@


rename lib/sha1.c to lib/hash.c It will soon grow functions to deal with sha256 too. stsp@ agrees.


include sha2.h too where sha1.h is included In preparation for wide sha256 support; stsp@ agrees. Change done mechanically with find . -iname \*.[cy] -exec sam {} + X ,x/<sha1\.h>/i/\n#include <sha2.h>


use newly publicised diff_chunk_type() diff API To skip chunks without newly added lines. ok stsp@


have ignore patterns with trailing slashes match directories only ok jamsek