]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Sync with 2.14.6
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 4 Dec 2019 20:26:31 +0000 (21:26 +0100)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 6 Dec 2019 15:26:55 +0000 (16:26 +0100)
* maint-2.14: (28 commits)
  Git 2.14.6
  mingw: handle `subst`-ed "DOS drives"
  mingw: refuse to access paths with trailing spaces or periods
  mingw: refuse to access paths with illegal characters
  unpack-trees: let merged_entry() pass through do_add_entry()'s errors
  quote-stress-test: offer to test quoting arguments for MSYS2 sh
  t6130/t9350: prepare for stringent Win32 path validation
  quote-stress-test: allow skipping some trials
  quote-stress-test: accept arguments to test via the command-line
  tests: add a helper to stress test argument quoting
  mingw: fix quoting of arguments
  Disallow dubiously-nested submodule git directories
  protect_ntfs: turn on NTFS protection by default
  path: also guard `.gitmodules` against NTFS Alternate Data Streams
  is_ntfs_dotgit(): speed it up
  mingw: disallow backslash characters in tree objects' file names
  path: safeguard `.git` against NTFS Alternate Streams Accesses
  clone --recurse-submodules: prevent name squatting on Windows
  is_ntfs_dotgit(): only verify the leading segment
  test-path-utils: offer to run a protectNTFS/protectHFS benchmark
  ...

16 files changed:
1  2 
builtin/clone.c
builtin/submodule--helper.c
compat/mingw.c
config.mak.uname
connect.c
environment.c
fast-import.c
fsck.c
git-compat-util.h
path.c
read-cache.c
submodule.c
submodule.h
transport-helper.c
tree-walk.c
unpack-trees.c

diff --cc builtin/clone.c
Simple merge
index 30e0bb876cffa1884267f616e0c31cb605f67019,3376b1bb293a414c795c70e1de5b8fa81d4f55d3..0d03fa8bf9ce49495b6bad0ed27ffb8b23587980
@@@ -860,9 -861,11 +871,11 @@@ static int prepare_to_clone_next_submod
                argv_array_pushl(&child->args, "--prefix", suc->prefix, NULL);
        if (suc->recommend_shallow && sub->recommend_shallow == 1)
                argv_array_push(&child->args, "--depth=1");
+       if (suc->require_init)
+               argv_array_push(&child->args, "--require-init");
        argv_array_pushl(&child->args, "--path", sub->path, NULL);
        argv_array_pushl(&child->args, "--name", sub->name, NULL);
 -      argv_array_pushl(&child->args, "--url", sub->url, NULL);
 +      argv_array_pushl(&child->args, "--url", url, NULL);
        if (suc->references.nr) {
                struct string_list_item *item;
                for_each_string_list_item(item, &suc->references)
diff --cc compat/mingw.c
Simple merge
Simple merge
diff --cc connect.c
Simple merge
diff --cc environment.c
Simple merge
diff --cc fast-import.c
Simple merge
diff --cc fsck.c
Simple merge
Simple merge
diff --cc path.c
Simple merge
diff --cc read-cache.c
Simple merge
diff --cc submodule.c
index 63e7094e1620c2c3eb7dda0a8c38a833ae2d1c5a,9abc90d9cdfd1663f42bcaaffe526361ba7e40fe..2ae209f208035339585e835c3d5022975a792b2f
@@@ -1794,6 -1837,52 +1794,47 @@@ int merge_submodule(struct object_id *r
        return 0;
  }
  
 -int parallel_submodules(void)
 -{
 -      return parallel_jobs;
 -}
 -
+ int validate_submodule_git_dir(char *git_dir, const char *submodule_name)
+ {
+       size_t len = strlen(git_dir), suffix_len = strlen(submodule_name);
+       char *p;
+       int ret = 0;
+       if (len <= suffix_len || (p = git_dir + len - suffix_len)[-1] != '/' ||
+           strcmp(p, submodule_name))
+               BUG("submodule name '%s' not a suffix of git dir '%s'",
+                   submodule_name, git_dir);
+       /*
+        * We prevent the contents of sibling submodules' git directories to
+        * clash.
+        *
+        * Example: having a submodule named `hippo` and another one named
+        * `hippo/hooks` would result in the git directories
+        * `.git/modules/hippo/` and `.git/modules/hippo/hooks/`, respectively,
+        * but the latter directory is already designated to contain the hooks
+        * of the former.
+        */
+       for (; *p; p++) {
+               if (is_dir_sep(*p)) {
+                       char c = *p;
+                       *p = '\0';
+                       if (is_git_directory(git_dir))
+                               ret = -1;
+                       *p = c;
+                       if (ret < 0)
+                               return error(_("submodule git dir '%s' is "
+                                              "inside git dir '%.*s'"),
+                                            git_dir,
+                                            (int)(p - git_dir), git_dir);
+               }
+       }
+       return 0;
+ }
  /*
   * Embeds a single submodules git directory into the superprojects git dir,
   * non recursively.
diff --cc submodule.h
Simple merge
Simple merge
diff --cc tree-walk.c
Simple merge
diff --cc unpack-trees.c
Simple merge