Merge branch 'nd/cache-tree-ita' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 8 Aug 2016 21:21:32 +0000 (14:21 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Aug 2016 21:21:33 +0000 (14:21 -0700)
"git add -N dir/file && git write-tree" produced an incorrect tree
when there are other paths in the same directory that sorts after
"file".

* nd/cache-tree-ita:
cache-tree: do not generate empty trees as a result of all i-t-a subentries
cache-tree.c: fix i-t-a entry skipping directory updates sometimes
test-lib.sh: introduce and use $EMPTY_BLOB
test-lib.sh: introduce and use $EMPTY_TREE

1  2 
t/test-lib.sh
diff --combined t/test-lib.sh
index 11201e9cf8320a0f90e4848d8bfe4ccd2ba92c88,9f36091bf81889fe4b6f54ad36796dde29633335..2e5afd696a21b005bca1915c2eb89d222c72c227
@@@ -162,6 -162,9 +162,9 @@@ _x40="$_x05$_x05$_x05$_x05$_x05$_x05$_x
  # Zero SHA-1
  _z40=0000000000000000000000000000000000000000
  
+ EMPTY_TREE=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+ EMPTY_BLOB=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
  # Line feed
  LF='
  '
  # when case-folding filenames
  u200c=$(printf '\342\200\214')
  
- export _x05 _x40 _z40 LF u200c
+ export _x05 _x40 _z40 LF u200c EMPTY_TREE EMPTY_BLOB
  
  # Each test should start with something like this, after copyright notices:
  #
@@@ -1111,12 -1114,3 +1114,12 @@@ run_with_limited_cmdline () 
  }
  
  test_lazy_prereq CMDLINE_LIMIT 'run_with_limited_cmdline true'
 +
 +build_option () {
 +      git version --build-options |
 +      sed -ne "s/^$1: //p"
 +}
 +
 +test_lazy_prereq LONG_IS_64BIT '
 +      test 8 -le "$(build_option sizeof-long)"
 +'