]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'sj/ref-consistency-checks-more'
authorJunio C Hamano <gitster@pobox.com>
Wed, 26 Mar 2025 07:26:09 +0000 (16:26 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 26 Mar 2025 07:26:10 +0000 (16:26 +0900)
"git fsck" becomes more careful when checking the refs.

* sj/ref-consistency-checks-more:
  builtin/fsck: add `git refs verify` child process
  packed-backend: check whether the "packed-refs" is sorted
  packed-backend: add "packed-refs" entry consistency check
  packed-backend: check whether the refname contains NUL characters
  packed-backend: add "packed-refs" header consistency check
  packed-backend: check if header starts with "# pack-refs with: "
  packed-backend: check whether the "packed-refs" is regular file
  builtin/refs: get worktrees without reading head information
  t0602: use subshell to ensure working directory unchanged

1  2 
Documentation/fsck-msgids.adoc
Documentation/git-fsck.adoc
builtin/fsck.c
builtin/refs.c
fsck.h
worktree.c
worktree.h

Simple merge
Simple merge
diff --cc builtin/fsck.c
Simple merge
diff --cc builtin/refs.c
Simple merge
diff --cc fsck.h
Simple merge
diff --cc worktree.c
index 6449b6798db35d9ee6efc6dd381dc03cb62d995d,89b7d86cef1af13c23e21625d47385eaafb8d20a..c34b9eb74e595af949d2c5ea8abf9687e90bbf0c
@@@ -199,14 -175,19 +199,19 @@@ struct worktree **get_worktrees(void
        return get_worktrees_internal(0);
  }
  
 -const char *get_worktree_git_dir(const struct worktree *wt)
+ struct worktree **get_worktrees_without_reading_head(void)
+ {
+       return get_worktrees_internal(1);
+ }
 +char *get_worktree_git_dir(const struct worktree *wt)
  {
        if (!wt)
 -              return repo_get_git_dir(the_repository);
 +              return xstrdup(repo_get_git_dir(the_repository));
        else if (!wt->id)
 -              return repo_get_common_dir(the_repository);
 +              return xstrdup(repo_get_common_dir(the_repository));
        else
 -              return git_common_path("worktrees/%s", wt->id);
 +              return repo_common_path(the_repository, "worktrees/%s", wt->id);
  }
  
  static struct worktree *find_worktree_by_suffix(struct worktree **list,
diff --cc worktree.h
Simple merge