Make lock local to fetch_pack

lock is only used by fetch_pack, so move it into that function.

Signed-off-by: Matt Kraai <matt.kraai@amo.abbott.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Port to QNX

Signed-off-by: Matt Kraai <matt.kraai@amo.abbott.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'sp/shortlog-missing-lf' into jch

When a line to be wrapped has a solid run of non space characters
whose length exactly is the wrap width, "git shortlog -w" failed to
add a newline after such a line.

Will cook in 'next'.

* sp/shortlog-missing-lf:
  strbuf_add_wrapped*(): Remove unused return value
  shortlog: fix wrapping lines of wraplen
Merge branch 'jc/maint-fbsd-sh-ifs-workaround' into jch

Will cook in 'next'.

* jc/maint-fbsd-sh-ifs-workaround:
  sh-setup: work around "unset IFS" bug in some shells
Merge branch 'jc/apply-trailing-blank-removal' into jch

Fix to update_pre_post_images() that did not take into account the
possibility that whitespace fix could shrink the preimage and
change the number of lines in it.

Will cook in 'next'.

* jc/apply-trailing-blank-removal:
  apply.c:update_pre_post_images(): the preimage can be truncated
Merge branch 'mh/ceiling' into jch

Elements of GIT_CEILING_DIRECTORIES list may not match the real
pathname we obtain from getcwd(), leading the GIT_DIR discovery
logic to escape the ceilings the user thought to have specified.

Resurrected from Stalled; the earlier performance fear was
unwarranted.

Will cook in 'next'.

* mh/ceiling:
  string_list_longest_prefix(): remove function
  setup_git_directory_gently_1(): resolve symlinks in ceiling paths
  longest_ancestor_length(): require prefix list entries to be normalized
  longest_ancestor_length(): take a string_list argument for prefixes
  longest_ancestor_length(): use string_list_split()
  Introduce new function real_path_if_valid()
  real_path_internal(): add comment explaining use of cwd
  Introduce new static function real_path_internal()

Conflicts:
	Documentation/technical/api-string-list.txt
	string-list.c
	string-list.h
Merge branch 'nd/wildmatch' into jch

Allows pathname patterns in .gitignore and .gitattributes files
with double-asterisks "foo/**/bar" to match any number of directory
hierarchies.

I suspect that this needs to be plugged to pathspec matching code;
otherwise "git log -- 'Docum*/**/*.txt'" would not show the log for
commits that touch Documentation/git.txt, which would be confusing
to the users.

Will cook in 'next'.

* nd/wildmatch:
  t3070: Disable some failing fnmatch tests
  test-wildmatch: avoid Windows path mangling
  Support "**" wildcard in .gitignore and .gitattributes
  wildmatch: make /**/ match zero or more directories
  wildmatch: adjust "**" behavior
  wildmatch: fix case-insensitive matching
  wildmatch: remove static variable force_lower_case
  wildmatch: make wildmatch's return value compatible with fnmatch
  t3070: disable unreliable fnmatch tests
  Integrate wildmatch to git
  wildmatch: follow Git's coding convention
  wildmatch: remove unnecessary functions
  Import wildmatch from rsync
  ctype: support iscntrl, ispunct, isxdigit and isprint
  ctype: make sane_ctype[] const array

Conflicts:
	Makefile
Merge branch 'rc/maint-complete-git-p4' into jch

Comment from Pete will need to be addressed in a follow-up patch.

* rc/maint-complete-git-p4:
  Teach git-completion about git p4
Merge branch 'mh/pthreads-autoconf' into jch

Will cook in 'next'.

* mh/pthreads-autoconf:
  configure.ac: fix pthreads detection on Mac OS X
Merge branch 'jk/fsck-dot-in-trees' into jch

Will cook in 'next'.

* jk/fsck-dot-in-trees:
  fsck: warn about ".git" in trees
  fsck: warn about '.' and '..' in trees
Merge branch 'jn/warn-on-inaccessible-loosen' into jch

An RFC to deal with a situation where .config/git is a file and we
notice .config/git/config is not readable due to ENOTDIR, not
ENOENT.

Will cook in 'next'.

* jn/warn-on-inaccessible-loosen:
  config: exit on error accessing any config file
  doc: advertise GIT_CONFIG_NOSYSTEM
  config: treat user and xdg config permission problems as errors
  config, gitignore: failure to access with ENOTDIR is ok
Merge branch 'nd/pathspec-wildcard' into jch

Will cook in 'next'.

* nd/pathspec-wildcard:
  tree_entry_interesting: do basedir compare on wildcard patterns when possible
  pathspec: apply "*.c" optimization from exclude
  pathspec: do exact comparison on the leading non-wildcard part
  pathspec: save the non-wildcard length part
Merge branch 'mh/unify-xml-in-imap-send-and-http-push' into jch

Update imap-send to reuse xml quoting code from http-push codepath,
clean up some code, and fix a small bug.

Will cook in 'next'.

* mh/unify-xml-in-imap-send-and-http-push:
  wrap_in_html(): process message in bulk rather than line-by-line
  wrap_in_html(): use strbuf_addstr_xml_quoted()
  imap-send: change msg_data from storing (ptr, len) to storing strbuf
  imap-send: correctly report errors reading from stdin
  imap-send: store all_msgs as a strbuf
  lf_to_crlf(): NUL-terminate msg_data::data
  xml_entities(): use function strbuf_addstr_xml_quoted()
  Add new function strbuf_add_xml_quoted()
Merge branch 'fc/fast-export-fixes' into jch

Will cook in 'next'.

* fc/fast-export-fixes:
  fast-export: make sure updated refs get updated
  fast-export: don't handle uninteresting refs
  fast-export: fix comparison in tests
  fast-export: trivial cleanup
  remote-testgit: implement the "done" feature manually
  remote-testgit: report success after an import
  remote-testgit: exercise more features
  remote-testgit: cleanup tests
  remote-testgit: remove irrelevant test
  remote-testgit: remove non-local functionality
  Add new simplified git-remote-testgit
  Rename git-remote-testgit to git-remote-testpy
  remote-helpers: fix failure message
  remote-testgit: fix direction of marks
  fast-export: avoid importing blob marks
Merge branch 'cr/push-force-tag-update' into jch

Require "-f" for push to update a tag, even if it is a fast-forward.

Will cook in 'next'.

* cr/push-force-tag-update:
  push: allow already-exists advice to be disabled
  push: rename config variable for more general use
  push: cleanup push rules comment
  push: clarify rejection of update to non-commit-ish
  push: require force for annotated tags
  push: require force for refs under refs/tags/
  push: flag updates that require force
  push: keep track of "update" state separately
  push: add advice for rejected tag reference
  push: return reject reasons as a bitset
Merge branch 'pf/editor-ignore-sigint' into jch

Avoid confusing cases where the user hits Ctrl-C while in the editor
session, not realizing git will receive the signal. Since most editors
will take over the terminal and will block SIGINT, this is not likely
to confuse anyone.

Will cook in 'next'.

* pf/editor-ignore-sigint:
  launch_editor: propagate signals from editor to git
  run-command: do not warn about child death from terminal
  launch_editor: ignore terminal signals while editor has control
  launch_editor: refactor to use start/finish_command
  run-command: drop silent_exec_failure arg from wait_or_whine
Merge branch 'jl/submodule-deinit' into jch

There was no Porcelain way to say "I no longer am interested in
this submodule", once you express your interest in a submodule with
"submodule init".  "submodule deinit" is the way to do so.

Will cook in 'next'.

* jl/submodule-deinit:
  submodule: add 'deinit' command
Merge branch 'sl/git-svn-docs' into jch

Will cook in 'next'.

* sl/git-svn-docs:
  git-svn: Note about tags.
  git-svn: Expand documentation for --follow-parent
  git-svn: Recommend use of structure options.
  git-svn: Document branches with at-sign(@).
Merge branch 'md/gitweb-sort-by-age' into jch

Gitweb showed repositories without any commit at the top in its
age-sorted view, in which the users are interested in looking at
active projects; sorting them at the bottom makes it more useful.

Will cook in 'next'.

* md/gitweb-sort-by-age:
  gitweb: Sort projects with undefined ages last
Merge branch 'ss/nedmalloc-compilation' into jch

Will cook in 'next'.

* ss/nedmalloc-compilation:
  nedmalloc: Fix a compile warning (exposed as error) with GCC 4.7.2