connect.c: SP after "}", not TAB

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
checkout_entry(): use the strbuf throughout the function

There is no need to break out the "buf" and "len" members into
separate temporary variables.  Rename path_buf to path and use
path.buf and path.len directly.  This makes it easier to reason about
the data flow in the function.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
entry.c: fix possible buffer overflow in remove_subtree()

remove_subtree() manipulated path in a fixed-size buffer even though
the length of the input, let alone the length of entries within the
directory, were not known in advance.  Change the function to take a
strbuf argument and use that object as its scratch space.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
install_branch_config(): simplify verbose messages logic

Replace the chain of if statements with table of strings.

Signed-off-by: Paweł Wawruch <pawlo@aleg.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cat-file: restore warn_on_object_refname_ambiguity flag

Commit 25fba78 turned off the object/refname ambiguity check
during "git cat-file --batch" operations. However, this is a
global flag, so let's restore it when we are done.

This shouldn't make any practical difference, as cat-file
exits immediately afterwards, but is good code hygeine and
would prevent an unnecessary surprise if somebody starts to
call cmd_cat_file later.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
rev-list: disable object/refname ambiguity check with --stdin

This is the "rev-list" analogue to 25fba78 (cat-file:
disable object/refname ambiguity check for batch mode,
2013-07-12).  Like cat-file, "rev-list --stdin" may read a
large number of sha1 object names, and the warning check
introduces a significant slow-down.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fsck.c:fsck_ident(): ident points at a const string

Since fsck_ident doesn't change the content of **ident, the type of
ident could be const char **.

This change is required to rewrite fsck_commit() to use skip_prefix().

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fsck.c:fsck_commit(): use skip_prefix() to verify and skip constant

fsck_commit() uses memcmp() to check if the buffer starts with a
certain prefix, and skips the prefix if it does.

This is exactly what skip_prefix() was designed for.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
request-pull: documentation updates

The original description talked only about what it does.  Instead,
start it with the purpose of the command, i.e. what it is used for,
and then mention what it does to achieve that goal.

Clarify what <start>, <url> and <end> means in the context of the
overall purpose of the command.

Describe the extended syntax of <end> parameter that is used when
the local branch name is different from the branch name at the
repository the changes are published.

Helped-by: Eric Sunshine
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'jk/clean-d-pathspec' into jch

"git clean -d pathspec" did not use the given pathspec correctly
and ended up cleaning too much.

* jk/clean-d-pathspec:
  clean: simplify dir/not-dir logic
  clean: respect pathspecs with "-d"
Merge branch 'jk/diff-filespec-cleanup' into jch

Portability fix to a topic already in v1.9

* jk/diff-filespec-cleanup:
  diffcore.h: be explicit about the signedness of is_binary
Merge branch 'nd/sha1-file-delta-stack-leakage-fix' into jch

Fix a small leak in the delta stack used when resolving a long
delta chain at runtime.

* nd/sha1-file-delta-stack-leakage-fix:
  sha1_file: fix delta_stack memory leak in unpack_entry
Merge branch 'tc/commit-dry-run-exit-status-tests' into jch

* tc/commit-dry-run-exit-status-tests:
  demonstrate git-commit --dry-run exit code behaviour
Merge branch 'fc/transport-helper-fixes' into jch

Updates transport-helper, fast-import and fast-export to allow the
ref mapping and ref deletion in a way similar to the natively
supported transports.

* fc/transport-helper-fixes:
  remote-bzr: support the new 'force' option
  test-hg.sh: tests are now expected to pass
  transport-helper.c: do not overwrite forced bit
  transport-helper: check for 'forced update' message
  transport-helper: add 'force' to 'export' helpers
  transport-helper: don't update refs in dry-run
  transport-helper: mismerge fix

# Conflicts:
# 	Documentation/gitremote-helpers.txt
Merge branch 'dd/find-graft-with-sha1-pos' into jch

Replace a hand-rolled binary search with a call to our generic
binary search helper function.

* dd/find-graft-with-sha1-pos:
  commit.c: use the generic "sha1_pos" function for lookup
Merge branch 'jk/shallow-update-fix' into jch

Serving objects from a shallow repository needs to write a
temporary file to be used, but the serving upload-pack may not have
write access to the repository which is meant to be read-only.

* jk/shallow-update-fix:
  shallow: automatically clean up shallow tempfiles
  shallow: use stat_validity to check for up-to-date file
Merge branch 'dd/use-alloc-grow' into jch

Replace open-coded reallocation with ALLOC_GROW() macro.

* dd/use-alloc-grow:
  sha1_file.c: use ALLOC_GROW() in pretend_sha1_file()
  read-cache.c: use ALLOC_GROW() in add_index_entry()
  builtin/mktree.c: use ALLOC_GROW() in append_to_tree()
  attr.c: use ALLOC_GROW() in handle_attr_line()
  dir.c: use ALLOC_GROW() in create_simplify()
  reflog-walk.c: use ALLOC_GROW()
  replace_object.c: use ALLOC_GROW() in register_replace_object()
  patch-ids.c: use ALLOC_GROW() in add_commit()
  diffcore-rename.c: use ALLOC_GROW()
  diff.c: use ALLOC_GROW()
  commit.c: use ALLOC_GROW() in register_commit_graft()
  cache-tree.c: use ALLOC_GROW() in find_subtree()
  bundle.c: use ALLOC_GROW() in add_to_ref_list()
  builtin/pack-objects.c: use ALLOC_GROW() in check_pbase_path()
Merge branch 'sh/finish-tmp-packfile' into jch

* sh/finish-tmp-packfile:
  finish_tmp_packfile():use strbuf for pathname construction
Merge branch 'jk/repack-pack-keep-objects' into jch

* jk/repack-pack-keep-objects:
  repack: add `repack.packKeptObjects` config var
Merge branch 'jk/detect-push-typo-early' into jch

Catch "git push $there no-such-branch" early.

* jk/detect-push-typo-early:
  push: detect local refspec errors early
  match_explicit_lhs: allow a "verify only" mode
  match_explicit: hoist refspec lhs checks into their own function