Sync with Git 2.17.1

* maint: (25 commits)
  Git 2.17.1
  Git 2.16.4
  Git 2.15.2
  Git 2.14.4
  Git 2.13.7
  fsck: complain when .gitmodules is a symlink
  index-pack: check .gitmodules files with --strict
  unpack-objects: call fsck_finish() after fscking objects
  fsck: call fsck_finish() after fscking objects
  fsck: check .gitmodules content
  fsck: handle promisor objects in .gitmodules check
  fsck: detect gitmodules files
  fsck: actually fsck blob data
  fsck: simplify ".git" check
  index-pack: make fsck error message more specific
  verify_path: disallow symlinks in .gitmodules
  update-index: stat updated files earlier
  verify_dotfile: mention case-insensitivity in comment
  verify_path: drop clever fallthrough
  skip_prefix: add case-insensitive variant
  ...
This commit is contained in:
Junio C Hamano
2018-05-29 17:09:58 +09:00
28 changed files with 801 additions and 79 deletions

View File

@ -79,6 +79,18 @@ pack_obj () {
;;
esac
# If it's not a delta, we can convince pack-objects to generate a pack
# with just our entry, and then strip off the header (12 bytes) and
# trailer (20 bytes).
if test -z "$2"
then
echo "$1" | git pack-objects --stdout >pack_obj.tmp &&
size=$(wc -c <pack_obj.tmp) &&
dd if=pack_obj.tmp bs=1 count=$((size - 20 - 12)) skip=12 &&
rm -f pack_obj.tmp
return
fi
echo >&2 "BUG: don't know how to print $1${2:+ (from $2)}"
return 1
}