Merge branch 'va/i18n'
authorJunio C Hamano <gitster@pobox.com>
Mon, 8 Aug 2016 21:48:38 +0000 (14:48 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Aug 2016 21:48:38 +0000 (14:48 -0700)
More i18n marking.

* va/i18n:
i18n: config: unfold error messages marked for translation
i18n: notes: mark comment for translation

1  2 
cache.h
submodule-config.c
diff --combined cache.h
index 6cddf2c1de906f1a45343acd3d268221c352ad3d,c8020981678cdfbe88dfc4c0751dfda17b1d11f5..e8128fc5d60579f461d60897fdd6483b3653d75c
+++ b/cache.h
@@@ -1230,8 -1230,7 +1230,8 @@@ struct date_mode 
                DATE_ISO8601_STRICT,
                DATE_RFC2822,
                DATE_STRFTIME,
 -              DATE_RAW
 +              DATE_RAW,
 +              DATE_UNIX
        } type;
        const char *strftime_fmt;
        int local;
@@@ -1516,7 -1515,7 +1516,7 @@@ struct object_info 
        /* Request */
        enum object_type *typep;
        unsigned long *sizep;
 -      unsigned long *disk_sizep;
 +      off_t *disk_sizep;
        unsigned char *delta_base_sha1;
        struct strbuf *typename;
  
@@@ -1567,10 -1566,18 +1567,18 @@@ struct git_config_source 
        const char *blob;
  };
  
+ enum config_origin_type {
+       CONFIG_ORIGIN_BLOB,
+       CONFIG_ORIGIN_FILE,
+       CONFIG_ORIGIN_STDIN,
+       CONFIG_ORIGIN_SUBMODULE_BLOB,
+       CONFIG_ORIGIN_CMDLINE
+ };
  typedef int (*config_fn_t)(const char *, const char *, void *);
  extern int git_default_config(const char *, const char *, void *);
  extern int git_config_from_file(config_fn_t fn, const char *, void *);
- extern int git_config_from_mem(config_fn_t fn, const char *origin_type,
+ extern int git_config_from_mem(config_fn_t fn, const enum config_origin_type,
                                        const char *name, const char *buf, size_t len, void *data);
  extern void git_config_push_parameter(const char *text);
  extern int git_config_from_parameters(config_fn_t fn, void *data);
@@@ -1714,7 -1721,7 +1722,7 @@@ extern int ignore_untracked_cache_confi
  struct key_value_info {
        const char *filename;
        int linenr;
-       const char *origin_type;
+       enum config_origin_type origin_type;
        enum config_scope scope;
  };
  
diff --combined submodule-config.c
index faedb1a4899639567d8d6d6af75338c26be8f7ae,1753e017557c385563269e6bf5417f0bf214b3b2..d22a851d2705fc44c608cdde1c31bea40b454ebb
@@@ -371,9 -371,9 +371,9 @@@ static int parse_config(const char *var
  }
  
  static int gitmodule_sha1_from_commit(const unsigned char *commit_sha1,
 -                                    unsigned char *gitmodules_sha1)
 +                                    unsigned char *gitmodules_sha1,
 +                                    struct strbuf *rev)
  {
 -      struct strbuf rev = STRBUF_INIT;
        int ret = 0;
  
        if (is_null_sha1(commit_sha1)) {
                return 1;
        }
  
 -      strbuf_addf(&rev, "%s:.gitmodules", sha1_to_hex(commit_sha1));
 -      if (get_sha1(rev.buf, gitmodules_sha1) >= 0)
 +      strbuf_addf(rev, "%s:.gitmodules", sha1_to_hex(commit_sha1));
 +      if (get_sha1(rev->buf, gitmodules_sha1) >= 0)
                ret = 1;
  
 -      strbuf_release(&rev);
        return ret;
  }
  
@@@ -398,7 -399,7 +398,7 @@@ static const struct submodule *config_f
  {
        struct strbuf rev = STRBUF_INIT;
        unsigned long config_size;
 -      char *config;
 +      char *config = NULL;
        unsigned char sha1[20];
        enum object_type type;
        const struct submodule *submodule = NULL;
                return entry->config;
        }
  
 -      if (!gitmodule_sha1_from_commit(commit_sha1, sha1))
 -              return NULL;
 +      if (!gitmodule_sha1_from_commit(commit_sha1, sha1, &rev))
 +              goto out;
  
        switch (lookup_type) {
        case lookup_name:
                break;
        }
        if (submodule)
 -              return submodule;
 +              goto out;
  
        config = read_sha1_file(sha1, &type, &config_size);
 -      if (!config)
 -              return NULL;
 -
 -      if (type != OBJ_BLOB) {
 -              free(config);
 -              return NULL;
 -      }
 +      if (!config || type != OBJ_BLOB)
 +              goto out;
  
        /* fill the submodule config into the cache */
        parameter.cache = cache;
        parameter.commit_sha1 = commit_sha1;
        parameter.gitmodules_sha1 = sha1;
        parameter.overwrite = 0;
-       git_config_from_mem(parse_config, "submodule-blob", rev.buf,
+       git_config_from_mem(parse_config, CONFIG_ORIGIN_SUBMODULE_BLOB, rev.buf,
                        config, config_size, &parameter);
 +      strbuf_release(&rev);
        free(config);
  
        switch (lookup_type) {
        default:
                return NULL;
        }
 +
 +out:
 +      strbuf_release(&rev);
 +      free(config);
 +      return submodule;
  }
  
  static const struct submodule *config_from_path(struct submodule_cache *cache,