From: Junio C Hamano Date: Tue, 17 May 2016 21:38:39 +0000 (-0700) Subject: Merge branch 'js/windows-dotgit' X-Git-Tag: v2.9.0-rc0~18 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/bfc99b63fe859e16ddcfcbe6ac09f98b8d06b34e Merge branch 'js/windows-dotgit' On Windows, .git and optionally any files whose name starts with a dot are now marked as hidden, with a core.hideDotFiles knob to customize this behaviour. * js/windows-dotgit: mingw: remove unnecessary definition mingw: introduce the 'core.hideDotFiles' setting --- bfc99b63fe859e16ddcfcbe6ac09f98b8d06b34e diff --cc environment.c index 2857e3f366,646f384aa9..ca72464a98 --- a/environment.c +++ b/environment.c @@@ -63,7 -64,9 +63,8 @@@ int grafts_replace_parents = 1 int core_apply_sparse_checkout; int merge_log_config = -1; int precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */ -struct startup_info *startup_info; unsigned long pack_size_limit_cfg; + enum hide_dotfiles_type hide_dotfiles = HIDE_DOTFILES_DOTGITONLY; #ifndef PROTECT_HFS_DEFAULT #define PROTECT_HFS_DEFAULT 0 diff --cc t/t5611-clone-config.sh index 27d730c0a7,0000000000..e4850b778c mode 100755,000000..100755 --- a/t/t5611-clone-config.sh +++ b/t/t5611-clone-config.sh @@@ -1,40 -1,0 +1,60 @@@ +#!/bin/sh + +test_description='tests for git clone -c key=value' +. ./test-lib.sh + +test_expect_success 'clone -c sets config in cloned repo' ' + rm -rf child && + git clone -c core.foo=bar . child && + echo bar >expect && + git --git-dir=child/.git config core.foo >actual && + test_cmp expect actual +' + +test_expect_success 'clone -c can set multi-keys' ' + rm -rf child && + git clone -c core.foo=bar -c core.foo=baz . child && + { echo bar; echo baz; } >expect && + git --git-dir=child/.git config --get-all core.foo >actual && + test_cmp expect actual +' + +test_expect_success 'clone -c without a value is boolean true' ' + rm -rf child && + git clone -c core.foo . child && + echo true >expect && + git --git-dir=child/.git config --bool core.foo >actual && + test_cmp expect actual +' + +test_expect_success 'clone -c config is available during clone' ' + echo content >file && + git add file && + git commit -m one && + rm -rf child && + git clone -c core.autocrlf . child && + printf "content\\r\\n" >expect && + test_cmp expect child/file +' + ++# Tests for the hidden file attribute on windows ++is_hidden () { ++ # Use the output of `attrib`, ignore the absolute path ++ case "$(attrib "$1")" in *H*?:*) return 0;; esac ++ return 1 ++} ++ ++test_expect_success MINGW 'clone -c core.hideDotFiles' ' ++ test_commit attributes .gitattributes "" && ++ rm -rf child && ++ git clone -c core.hideDotFiles=false . child && ++ ! is_hidden child/.gitattributes && ++ rm -rf child && ++ git clone -c core.hideDotFiles=dotGitOnly . child && ++ ! is_hidden child/.gitattributes && ++ rm -rf child && ++ git clone -c core.hideDotFiles=true . child && ++ is_hidden child/.gitattributes ++' ++ +test_done