FIXUP: minimum compilation fix
use strchrnul() in place of strchr() and strlen()

Avoid scanning strings twice, once with strchr() and then with
strlen(), by using strchrnul(). Update the conditional expressions
involving the return value of strchrnul() with a check for '\0'.

Signed-off-by: Rohit Mani <rohit.mani@outlook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
SQUASH???
t3200-branch: test setting branch as own upstream

No test asserts that "git branch -u refs/heads/my-branch my-branch"
avoids leaving nonsense configuration and emits a warning.

Add a test that does so.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
branch: use skip_prefix() in install_branch_config()

The install_branch_config() function reimplemented the skip_prefix()
function inline.

Reported-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Use hashcpy() when copying object names

We invented hashcpy() to keep the abstraction of "object name"
behind it.  Use it instead of calling memcpy() with hard-coded
20-byte length when moving object names between pieces of memory.

Leave ppc/sha1.c as-is, because the function is about the SHA-1 hash
algorithm whose output is and will always be 20 bytes.

Helped-by: Michael Haggerty <mhagger@alum.mit.edu>
Helped-by: Duy Nguyen <pclouds@gmail.com>
Signed-off-by: Sun He <sunheehnus@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'jc/check-attr-honor-working-tree' into jch

"git check-attr" when (trying to) work on a repository with a
working tree did not work well when the working tree was specified
via --work-tree (and obviously with --git-dir).

The command also works in a bare repository but it reads from the
(possibly stale, irrelevant and/or nonexistent) index, which may
need to be fixed to read from HEAD, but that is a completely
separate issue.  As a related tangentto this separate issue, we may
want to also fix "check-ignore", which refuses to work in a bare
repository, to also operate in a bare one.

* jc/check-attr-honor-working-tree:
  check-attr: move to the top of working tree when in non-bare repository
  t0003: do not chdir the whole test process

# Conflicts:
# 	t/t0003-attributes.sh
Merge branch 'nd/gitignore-trailing-whitespace' into jch

Warn and then ignore trailing whitespaces in .gitignore files,
unless they are quoted for fnmatch(3), e.g. "path\ ".

* nd/gitignore-trailing-whitespace:
  dir: ignore trailing spaces in exclude patterns
  dir: warn about trailing spaces in exclude patterns
Merge branch 'ss/completion-rec-sub-fetch-push' into jch

* ss/completion-rec-sub-fetch-push:
  completion: teach --recurse-submodules to fetch, pull and push
Merge branch 'jk/http-no-curl-easy' into jch

Avoid use of the curl-easy family of functions, which interferes
with connection reuse in a negative way.

* jk/http-no-curl-easy:
  http: never use curl_easy_perform
Merge branch 'jk/janitorial-fixes' into jch

* jk/janitorial-fixes:
  open_istream(): do not dereference NULL in the error case
  builtin/mv: don't use memory after free
  utf8: use correct type for values in interval table
  utf8: fix iconv error detection
  notes-utils: handle boolean notes.rewritemode correctly
Merge branch 'ks/config-file-stdin' into jch

* ks/config-file-stdin:
  config: teach "git config --file -" to read from the standard input
  config: change git_config_with_options() interface
  builtin/config.c: rename check_blob_write() -> check_write()
  config: disallow relative include paths from blobs
Merge branch 'lb/contrib-contacts-looser-diff-parsing' into jch

* lb/contrib-contacts-looser-diff-parsing:
  git-contacts: do not fail parsing of good diffs
Merge branch 'nd/reset-setup-worktree' into jch

"git reset" needs to refresh the index when working in a working
tree (it can also be used to match the index to the HEAD in an
otherwise bare repository), but it failed to set up the working
tree properly, causing GIT_WORK_TREE to be ignored.

* nd/reset-setup-worktree:
  reset: optionally setup worktree and refresh index on --mixed

# Conflicts:
# 	t/t7102-reset.sh
Merge branch 'tr/diff-submodule-no-reuse-worktree' into jch

"git diff --external-diff" incorrectly fed the submodule directory
in the working tree to the external diff driver when it knew it is
the same as one of the versions being compared.

* tr/diff-submodule-no-reuse-worktree:
  diff: do not reuse_worktree_file for submodules
Merge branch 'ak/gitweb-fit-image' into jch

Instead of allowing an <img> to be shown in whatever size, force
scaling it to fit on the page with max-height/max-width css style
attributes.

* ak/gitweb-fit-image:
  gitweb: Avoid overflowing page body frame with large images
Merge branch 'nd/no-more-fnmatch' into jch

We started using wildmatch() in place of fnmatch(3); complete the
process and stop using fnmatch(3).

* nd/no-more-fnmatch:
  actually remove compat fnmatch source code
  stop using fnmatch (either native or compat)
  Revert "test-wildmatch: add "perf" command to compare wildmatch and fnmatch"
  use wildmatch() directly without fnmatch() wrapper
Merge branch 'rt/links-for-asciidoctor' into jch

* rt/links-for-asciidoctor:
  Documentation: fix documentation AsciiDoc links for external urls
Merge branch 'jh/note-trees-record-blobs' into jch

"git notes -C <blob>" should not take an object that is not a blob.

* jh/note-trees-record-blobs:
  notes: disallow reusing non-blob as a note object
Merge branch 'jk/commit-dates-parsing-fix' into jch

* jk/commit-dates-parsing-fix:
  log: do not segfault on gmtime errors
  log: handle integer overflow in timestamps
  date: check date overflow against time_t
  fsck: report integer overflow in author timestamps
  t4212: test bogus timestamps with git-log