Merge branch 'js/windows-dotgit'
authorJunio C Hamano <gitster@pobox.com>
Tue, 17 May 2016 21:38:39 +0000 (14:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 May 2016 21:38:39 +0000 (14:38 -0700)
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

1  2 
Documentation/config.txt
cache.h
compat/mingw.c
compat/mingw.h
config.c
environment.c
t/t5611-clone-config.sh
Simple merge
diff --cc cache.h
Simple merge
diff --cc compat/mingw.c
Simple merge
diff --cc compat/mingw.h
Simple merge
diff --cc config.c
Simple merge
diff --cc environment.c
index 2857e3f3662ef3b3ce6e062d0413e995179598ba,646f384aa99d1914a6a4fca417b65ca340f9a9ee..ca72464a985021e58b898bb0b1f9af6c4a5282ac
@@@ -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
index 27d730c0a7209480c5349e4ace65f92c9e75c699,0000000000000000000000000000000000000000..e4850b778c2f20df02ce187cc8cd057df2759d7d
mode 100755,000000..100755
--- /dev/null
@@@ -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