]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Sync with 2.43.4
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 10 Apr 2024 20:10:06 +0000 (22:10 +0200)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 19 Apr 2024 10:38:54 +0000 (12:38 +0200)
* maint-2.43: (40 commits)
  Git 2.43.4
  Git 2.42.2
  Git 2.41.1
  Git 2.40.2
  Git 2.39.4
  fsck: warn about symlink pointing inside a gitdir
  core.hooksPath: add some protection while cloning
  init.templateDir: consider this config setting protected
  clone: prevent hooks from running during a clone
  Add a helper function to compare file contents
  init: refactor the template directory discovery into its own function
  find_hook(): refactor the `STRIP_EXTENSION` logic
  clone: when symbolic links collide with directories, keep the latter
  entry: report more colliding paths
  t5510: verify that D/F confusion cannot lead to an RCE
  submodule: require the submodule path to contain directories only
  clone_submodule: avoid using `access()` on directories
  submodules: submodule paths must not contain symlinks
  clone: prevent clashing git dirs when cloning submodule in parallel
  t7423: add tests for symlinked submodule directories
  ...

15 files changed:
1  2 
Documentation/git.txt
builtin/clone.c
config.c
dir.c
fsck.c
path.c
read-cache.c
remote-curl.c
repository.c
setup.c
setup.h
t/t1450-fsck.sh
t/t5510-fetch.sh
t/t5601-clone.sh
t/t7450-bad-git-dotfiles.sh

Simple merge
diff --cc builtin/clone.c
index bad1b70ce8255156cf4745aca5e120371d39642d,85ee7da1fae3ab08b8c08aac80766b88f12f6e64..4933771822c70623f43dcdafb4c4c1d27674bb48
@@@ -934,8 -960,9 +963,10 @@@ int cmd_clone(int argc, const char **ar
        int submodule_progress;
        int filter_submodules = 0;
        int hash_algo;
 +      unsigned int ref_storage_format = REF_STORAGE_FORMAT_UNKNOWN;
        const int do_not_override_repo_unix_permissions = -1;
+       const char *template_dir;
+       char *template_dir_dup = NULL;
  
        struct transport_ls_refs_options transport_ls_refs_options =
                TRANSPORT_LS_REFS_OPTIONS_INIT;
                }
        }
  
 -      init_db(git_dir, real_git_dir, template_dir, GIT_HASH_UNKNOWN, NULL,
 -              do_not_override_repo_unix_permissions, INIT_DB_QUIET);
 +      /*
 +       * Initialize the repository, but skip initializing the reference
 +       * database. We do not yet know about the object format of the
 +       * repository, and reference backends may persist that information into
 +       * their on-disk data structures.
 +       */
-       init_db(git_dir, real_git_dir, option_template, GIT_HASH_UNKNOWN,
++      init_db(git_dir, real_git_dir, template_dir, GIT_HASH_UNKNOWN,
 +              ref_storage_format, NULL,
 +              do_not_override_repo_unix_permissions, INIT_DB_QUIET | INIT_DB_SKIP_REFDB);
  
        if (real_git_dir) {
                free((char *)git_dir);
diff --cc config.c
Simple merge
diff --cc dir.c
Simple merge
diff --cc fsck.c
Simple merge
diff --cc path.c
Simple merge
diff --cc read-cache.c
Simple merge
diff --cc remote-curl.c
Simple merge
diff --cc repository.c
Simple merge
diff --cc setup.c
index b69b1cbc2adb41aa5f4df8b1aff88761ea2cba5c,a4de5c7b5a28eb23c8a0af616c37c1ba9f38e9ac..76a7b1f7c20a7388f0940b27436c8d492e513e8a
+++ b/setup.c
@@@ -1967,9 -1963,10 +2033,8 @@@ static int create_default_files(const c
        struct stat st1;
        struct strbuf buf = STRBUF_INIT;
        char *path;
 -      char junk[2];
        int reinit;
        int filemode;
-       const char *init_template_dir = NULL;
 -      struct strbuf err = STRBUF_INIT;
        const char *work_tree = get_git_work_tree();
  
        /*
diff --cc setup.h
index 3599aec93c5ac0b72aafaf3cdcb030831cc53e3b,01a6ad77358f135c9e7333ac3e25aa82db1b84f7..3ba2608764b3e609039c01f8bbe0925ac054dd6f
+++ b/setup.h
@@@ -171,9 -181,10 +183,11 @@@ int verify_repository_format(const stru
   */
  void check_repository_format(struct repository_format *fmt);
  
 -#define INIT_DB_QUIET 0x0001
 -#define INIT_DB_EXIST_OK 0x0002
+ const char *get_template_dir(const char *option_template);
 +#define INIT_DB_QUIET      (1 << 0)
 +#define INIT_DB_EXIST_OK   (1 << 1)
 +#define INIT_DB_SKIP_REFDB (1 << 2)
  
  int init_db(const char *git_dir, const char *real_git_dir,
            const char *template_dir, int hash_algo,
diff --cc t/t1450-fsck.sh
Simple merge
Simple merge
Simple merge
Simple merge