Ignore:
Timestamp:
Jun 23, 2014, 9:45:51 PM (11 years ago)
Author:
dmik
Message:

git: Merge version 2.0.0 from vendor to dmik branch.

Location:
git/branches/dmik
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • git/branches/dmik

  • TabularUnified git/branches/dmik/environment.c

    r626 r782  
    1111#include "refs.h"
    1212#include "fmt-merge-msg.h"
    13 
    14 char git_default_email[MAX_GITNAME];
    15 char git_default_name[MAX_GITNAME];
    16 int user_ident_explicitly_given;
     13#include "commit.h"
     14
    1715int trust_executable_bit = 1;
    1816int trust_ctime = 1;
     17int check_stat = 1;
    1918int has_symlinks = 1;
    2019int minimum_abbrev = 4, default_abbrev = 7;
     
    2524int log_all_ref_updates = -1; /* unspecified */
    2625int warn_ambiguous_refs = 1;
     26int warn_on_object_refname_ambiguity = 1;
    2727int repository_format_version;
    2828const char *git_commit_encoding;
     
    4040size_t delta_base_cache_limit = 16 * 1024 * 1024;
    4141unsigned long big_file_threshold = 512 * 1024 * 1024;
    42 const char *log_pack_access;
    4342const char *pager_program;
    4443int pager_use_color = 1;
     
    4746const char *excludes_file;
    4847enum auto_crlf auto_crlf = AUTO_CRLF_FALSE;
    49 int read_replace_refs = 1; /* NEEDSWORK: rename to use_replace_refs */
     48int check_replace_refs = 1;
    5049enum eol core_eol = EOL_UNSET;
    5150enum safe_crlf safe_crlf = SAFE_CRLF_WARN;
     
    5352enum branch_track git_branch_track = BRANCH_TRACK_REMOTE;
    5453enum rebase_setup_type autorebase = AUTOREBASE_NEVER;
    55 enum push_default_type push_default = PUSH_DEFAULT_MATCHING;
     54enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;
    5655#ifndef OBJECT_CREATION_MODE
    5756#define OBJECT_CREATION_MODE OBJECT_CREATION_USES_HARDLINKS
     
    6261int core_apply_sparse_checkout;
    6362int merge_log_config = -1;
     63int precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */
    6464struct startup_info *startup_info;
    6565unsigned long pack_size_limit_cfg;
     66
     67/*
     68 * The character that begins a commented line in user-editable file
     69 * that is subject to stripspace.
     70 */
     71char comment_line_char = '#';
    6672
    6773/* Parallel index stat data preload? */
     
    7985
    8086/*
    81  * Repository-local GIT_* environment variables
    82  * Remember to update local_repo_env_size in cache.h when
    83  * the size of the list changes
    84  */
    85 const char * const local_repo_env[LOCAL_REPO_ENV_SIZE + 1] = {
     87 * Repository-local GIT_* environment variables; see cache.h for details.
     88 */
     89const char * const local_repo_env[] = {
    8690        ALTERNATE_DB_ENVIRONMENT,
    8791        CONFIG_ENVIRONMENT,
     
    9094        GIT_DIR_ENVIRONMENT,
    9195        GIT_WORK_TREE_ENVIRONMENT,
     96        GIT_IMPLICIT_WORK_TREE_ENVIRONMENT,
    9297        GRAFT_ENVIRONMENT,
    9398        INDEX_ENVIRONMENT,
    9499        NO_REPLACE_OBJECTS_ENVIRONMENT,
     100        GIT_PREFIX_ENVIRONMENT,
     101        GIT_SHALLOW_FILE_ENVIRONMENT,
    95102        NULL
    96103};
     
    119126static void setup_git_env(void)
    120127{
     128        const char *gitfile;
     129        const char *shallow_file;
     130
    121131        git_dir = getenv(GIT_DIR_ENVIRONMENT);
    122         git_dir = git_dir ? xstrdup(git_dir) : NULL;
    123         if (!git_dir) {
    124                 git_dir = read_gitfile(DEFAULT_GIT_DIR_ENVIRONMENT);
    125                 git_dir = git_dir ? xstrdup(git_dir) : NULL;
    126         }
    127132        if (!git_dir)
    128133                git_dir = DEFAULT_GIT_DIR_ENVIRONMENT;
     134        gitfile = read_gitfile(git_dir);
     135        git_dir = xstrdup(gitfile ? gitfile : git_dir);
    129136        git_object_dir = getenv(DB_ENVIRONMENT);
    130137        if (!git_object_dir) {
     
    141148                git_graft_file = git_pathdup("info/grafts");
    142149        if (getenv(NO_REPLACE_OBJECTS_ENVIRONMENT))
    143                 read_replace_refs = 0;
     150                check_replace_refs = 0;
    144151        namespace = expand_namespace(getenv(GIT_NAMESPACE_ENVIRONMENT));
    145152        namespace_len = strlen(namespace);
     153        shallow_file = getenv(GIT_SHALLOW_FILE_ENVIRONMENT);
     154        if (shallow_file)
     155                set_alternate_shallow_file(shallow_file, 0);
    146156}
    147157
     
    152162}
    153163
    154 int have_git_dir(void)
    155 {
    156         return !!git_dir;
    157 }
    158 
    159164const char *get_git_dir(void)
    160165{
     
    173178const char *strip_namespace(const char *namespaced_ref)
    174179{
    175         if (prefixcmp(namespaced_ref, get_git_namespace()) != 0)
     180        if (!starts_with(namespaced_ref, get_git_namespace()))
    176181                return NULL;
    177182        return namespaced_ref + namespace_len;
     
    233238}
    234239
    235 int odb_pack_keep(char *name, size_t namesz, unsigned char *sha1)
     240int odb_pack_keep(char *name, size_t namesz, const unsigned char *sha1)
    236241{
    237242        int fd;
Note: See TracChangeset for help on using the changeset viewer.