Commits


fix replacing symlinks with files And add a test case which verifies that the inverse also works, i.e. a symlink being replaced with a regular file. problem reported and fix tested by jrick


fix missing unlink(tmppath) in error cases of install_blob()


clear staged file type in file index entries whenever staged status is cleared


initialize sb.st_mode after stat(2) failure in got_worktree_resolve_path()


avoid got_repo_map_path() in 'got blame' 'got blame' does not need access to the work tree. So far the work tree was completely hidden with unveil(). We must now expose the work tree while resolving the path, so unveil() calls are shuffled around slightly. Failing realpath() calls would mess with path resolution otherwise. There's a bug in got_worktree_resolve_path() where it failed to canonicalize a path constructed from a user-specified path that does not exist on disk. Note that this path falls into strncmp() a few lines down. I am fixing this by adding canonicalization. Generally, joining paths with asprintf() and comparing paths with strncmp() is fragile. A more general solution might be needed but I am leaving that for another day. ok naddy


convert all remaining instances of chmod(2) to fchmod(2) ok stsp


indentation fixes


plug memory leaks in error paths; found by naddy


use got_path_dirname() in schedule_for_deletion(); avoids const dirname(3) ok naddy


use got_path_dirname() in remove_ondisk_file(); avoids const dirname(3) ok naddy


use got_path_dirname() in install_blob() to avoid const dirname(3) ok naddy


use got_path_dirname() in install_symlink() to avoid const dirname(3) ok naddy


use got_path_dirname() in is_bad_symlink_target() ok naddy


use got_path_dirname() in merge_blob() instead of assuming const dirname(3) ok naddy


make merge_file() use got_path_dirname() instead of assuming const dirname(3) ok naddy


adapt got_open_worktree to non-const dirname(3) ok naddy


use got_path_basename() in match_deleted_or_modified_ct() ok millert


switch to got_path_basename() in alloc_added_blob_tree_entry() ok millert


switch to got_path_basename in revert_file ok millert


fix a bug where 'got status' showed an unchanged empty file as changed


make 'got histedit' collapse folded add+delete operations into a no-op If a merged commit wants to delete a locally added file, and this locally added file matches the content which was deleted in the commit being merged, we can go ahead with the deletion because there is no risk of data loss. fixes the histedit problem reported by jrick on freenode


add per-worktree got.conf(5) file in the .got directory; ok millert


use modern POSIX timestamp fields in struct stat ok stsp


add -s option to 'got remove' which deletes files in a particular status This makes it easy to deal with files that were deleted from disk by external tooling which modified the work tree. Such files are left in missing (!) status and can now be marked for deletion in bulk via 'got rm -s\! -R .' For consistency, modified (M) files can now be removed with 'got rm -s M' which implies 'got rm -f'. Prompted by feedback from krw@


fix committing file additions from a work tree with a path prefix New files were added under the wrong tree in the repository if the work tree has a path prefix. Fix this problem and catch it in the existing commit_with_path_prefix regression test.