]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Sync with Git 2.13.7
authorJunio C Hamano <gitster@pobox.com>
Tue, 22 May 2018 05:10:49 +0000 (14:10 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 May 2018 05:10:49 +0000 (14:10 +0900)
* maint-2.13:
  Git 2.13.7
  verify_path: disallow symlinks in .gitmodules
  update-index: stat updated files earlier
  verify_dotfile: mention case-insensitivity in comment
  verify_path: drop clever fallthrough
  skip_prefix: add case-insensitive variant
  is_{hfs,ntfs}_dotgitmodules: add tests
  is_ntfs_dotgit: match other .git files
  is_hfs_dotgit: match other .git files
  is_ntfs_dotgit: use a size_t for traversing string
  submodule-config: verify submodule names as paths

1  2 
apply.c
builtin/submodule--helper.c
builtin/update-index.c
cache.h
git-compat-util.h
git-submodule.sh
path.c
read-cache.c
submodule-config.c
submodule-config.h
t/helper/test-path-utils.c

diff --cc apply.c
Simple merge
index 895555c93a3bb86ad5511a2ded2350614732d618,b4b4d29d82896e706be44f8509cb39a6e34037fa..e8ccddd3b1b4473a23a5b50434a140f526f5ca7a
@@@ -1224,9 -1192,32 +1224,32 @@@ static int is_active(int argc, const ch
  
        gitmodules_config();
  
 -      return !is_submodule_initialized(argv[1]);
 +      return !is_submodule_active(the_repository, argv[1]);
  }
  
+ /*
+  * Exit non-zero if any of the submodule names given on the command line is
+  * invalid. If no names are given, filter stdin to print only valid names
+  * (which is primarily intended for testing).
+  */
+ static int check_name(int argc, const char **argv, const char *prefix)
+ {
+       if (argc > 1) {
+               while (*++argv) {
+                       if (check_submodule_name(*argv) < 0)
+                               return 1;
+               }
+       } else {
+               struct strbuf buf = STRBUF_INIT;
+               while (strbuf_getline(&buf, stdin) != EOF) {
+                       if (!check_submodule_name(buf.buf))
+                               printf("%s\n", buf.buf);
+               }
+               strbuf_release(&buf);
+       }
+       return 0;
+ }
  #define SUPPORT_SUPER_PREFIX (1<<0)
  
  struct cmd_struct {
Simple merge
diff --cc cache.h
index 5cc116ba4221f6655271d867a9bcc445b1bd26ad,5a44f79e263b650472b650b72de3b5430243f273..ffadd5bc7082fa2197d0ce63bb224a635c566de7
+++ b/cache.h
@@@ -604,9 -597,8 +604,9 @@@ extern int read_index_unmerged(struct i
  #define CLOSE_LOCK            (1 << 1)
  extern int write_locked_index(struct index_state *, struct lock_file *lock, unsigned flags);
  extern int discard_index(struct index_state *);
 +extern void move_index_extensions(struct index_state *dst, struct index_state *src);
  extern int unmerged_index(const struct index_state *);
- extern int verify_path(const char *path);
+ extern int verify_path(const char *path, unsigned mode);
  extern int strcmp_offset(const char *s1, const char *s2, size_t *first_change);
  extern int index_dir_exists(struct index_state *istate, const char *name, int namelen);
  extern void adjust_dirname_case(struct index_state *istate, char *name);
Simple merge
Simple merge
diff --cc path.c
Simple merge
diff --cc read-cache.c
Simple merge
Simple merge
Simple merge
index 2b3c5092a199835ea2e84339b473a9e29778178d,77517a43edf6cd1549a0267352a27b226e1ea6a5..94846550f74a843f979de14116ab2df5dd15f6e3
@@@ -265,11 -257,25 +271,25 @@@ int cmd_main(int argc, const char **arg
        }
  
        if (argc == 2 && !strcmp(argv[1], "basename"))
 -              return test_function(basename_data, basename, argv[1]);
 +              return test_function(basename_data, posix_basename, argv[1]);
  
        if (argc == 2 && !strcmp(argv[1], "dirname"))
 -              return test_function(dirname_data, dirname, argv[1]);
 +              return test_function(dirname_data, posix_dirname, argv[1]);
  
+       if (argc > 2 && !strcmp(argv[1], "is_dotgitmodules")) {
+               int res = 0, expect = 1, i;
+               for (i = 2; i < argc; i++)
+                       if (!strcmp("--not", argv[i]))
+                               expect = !expect;
+                       else if (expect != is_dotgitmodules(argv[i]))
+                               res = error("'%s' is %s.gitmodules", argv[i],
+                                           expect ? "not " : "");
+                       else
+                               fprintf(stderr, "ok: '%s' is %s.gitmodules\n",
+                                       argv[i], expect ? "" : "not ");
+               return !!res;
+       }
        fprintf(stderr, "%s: unknown function name: %s\n", argv[0],
                argv[1] ? argv[1] : "(there was none)");
        return 1;