git-new-workdir: don't fail if the target directory is empty

Allow new workdirs to be created in an empty directory (similar to "git
clone").  Provide more error checking and clean up on failure.

Signed-off-by: Paul Smith <paul@mad-scientist.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'ps/new-workdir-into-empty-directory' into jch

* ps/new-workdir-into-empty-directory:
  git-new-workdir: don't fail if the target directory is empty
Merge branch 'js/push-to-deploy' into jch

"git push" into a repository with a working tree normally refuses
to modify the branch that is checked out.  The command learned to
optionally do an equivalent of "git reset --hard" only when there
is no change to the working tree and the index instead, which would
be useful to "deploy" by pushing into a repository.

* js/push-to-deploy:
  t5516: more tests for receive.denyCurrentBranch=updateInstead
  receive-pack: add another option for receive.denyCurrentBranch
Merge branch 'cc/interpret-trailers-more' into jch

* cc/interpret-trailers-more:
  trailer: add test with an old style conflict block
  trailer: reuse ignore_non_trailer() to ignore conflict lines
  commit: make ignore_non_trailer() non static
Merge branch 'jc/unpack-trees-plug-leak' into jch

* jc/unpack-trees-plug-leak:
  unpack_trees: plug leakage of o->result
Merge branch 'rt/push-recurse-submodule-usage-string' into jch

* rt/push-recurse-submodule-usage-string:
  builtin/push.c: fix description of --recurse-submodules option
Merge branch 'po/everyday-doc' into jch

* po/everyday-doc:
  Documentation: change "gitlink" typo in git-push
Merge branch 'mh/config-copy-string-from-git-path' into jch

* mh/config-copy-string-from-git-path:
  cmd_config(): make a copy of path obtained from git_path()
Merge branch 'sv/doc-stripspace' into jch

* sv/doc-stripspace:
  Documentation/git-stripspace: Update synopsis
Merge branch 'sv/typofix-apply-error-message' into jch

* sv/typofix-apply-error-message:
  apply: fix typo in an error message
Merge branch 'sb/log-ref-write-fd' into jch

Moves a part of function around to add a helper that still only has
one caller.  Need to see how this helps in a bigger picture;
conflicts with nd/multiple-work-trees.

* sb/log-ref-write-fd:
  refs.c: add a function to append a reflog entry to a fd
Merge branch 'mh/simplify-repack-without-refs' into jch

* mh/simplify-repack-without-refs:
  sort_string_list(): rename to string_list_sort()
  prune_remote(): iterate using for_each_string_list_item()
  prune_remote(): rename local variable
  repack_without_refs(): make the refnames argument a string_list
  prune_remote(): sort delete_refs_list references en masse
  prune_remote(): initialize both delete_refs lists in a single loop
  prune_remote(): exit early if there are no stale references
Merge branch 'jk/lock-ref-sha1-basic-return-errors' into jch

* jk/lock-ref-sha1-basic-return-errors:
  lock_ref_sha1_basic: do not die on locking errors
Merge branch 'sb/ref-transaction-unify-to-update' into jch

Code simplification.

* sb/ref-transaction-unify-to-update:
  refs.c: make ref_transaction_delete a wrapper for ref_transaction_update
  refs.c: make ref_transaction_create a wrapper for ref_transaction_update
Merge branch 'jk/colors-fix' into jch

* jk/colors-fix:
  t4026: test "normal" color
  config: fix parsing of "git config --get-color some.key -1"
  docs: describe ANSI 256-color mode
Merge branch 'jk/colors' into jch

* jk/colors:
  diff-highlight: allow configurable colors
  parse_color: recognize "no$foo" to clear the $foo attribute
  parse_color: support 24-bit RGB values
  parse_color: refactor color storage
Merge branch 'sb/copy-fd-errno' into jch

Jonathan seems to be working in the same area, having a moral
equivalent.  Have to drop either this or the other one.

* sb/copy-fd-errno:
  copy.c: make copy_fd preserve meaningful errno
Merge branch 'da/difftool-mergetool-simplify-reporting-status' into jch

* da/difftool-mergetool-simplify-reporting-status:
  mergetools: stop setting $status in merge_cmd()
  mergetool: simplify conditionals
  difftool--helper: add explicit exit statement
  mergetool--lib: remove use of $status global
  mergetool--lib: remove no-op assignment to $status from setup_user_tool
Merge branch 'nd/ls-tree-pathspec' into jch

"git ls-tree" does not support path selection based on negative
pathspecs, but did not error out when negative pathspecs are given.

* nd/ls-tree-pathspec:
  t3102: style modernization
  t3102: document that ls-tree does not yet support negated pathspec
  ls-tree: disable negative pathspec because it's not supported
  ls-tree: remove path filtering logic in show_tree
  tree.c: update read_tree_recursive callback to pass strbuf as base
Merge branch 'jc/hook-cleanup' into jch

* jc/hook-cleanup:
  run-command.c: retire unused run_hook_with_custom_index()