OSDN Git Service

git-core/git.git
9 years agot: fix moderate &&-chain breakage
Jeff King [Fri, 20 Mar 2015 10:06:44 +0000 (06:06 -0400)]
t: fix moderate &&-chain breakage

These are tests which are missing a link in their &&-chain,
but in a way that probably does not effect the outcome of
the test. Most of these are of the form:

  some_cmd >actual
  test_cmp expect actual

The main point of the test is to verify the output, and a
failure in some_cmd would probably be noticed by bogus
output. But it is good for the tests to also confirm that
"some_cmd" does not die unexpectedly after producing its
output.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot: fix severe &&-chain breakage
Jeff King [Fri, 20 Mar 2015 10:06:15 +0000 (06:06 -0400)]
t: fix severe &&-chain breakage

These are tests which are missing a link in their &&-chain,
in a location which causes a significant portion of the test
to be missed (e.g., the test effectively does nothing, or
consists of a long string of actions and output comparisons,
and we throw away the exit code of at least one part of the
string).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot/test-lib: introduce --chain-lint option
Jeff King [Fri, 20 Mar 2015 10:05:48 +0000 (06:05 -0400)]
t/test-lib: introduce --chain-lint option

It's easy to miss an "&&"-chain in a test script, like:

  test_expect_success 'check something important' '
cmd1 &&
cmd2
cmd3
  '

The test harness will notice if cmd3 fails, but a failure of
cmd1 or cmd2 will go unnoticed, as their exit status is lost
after cmd3 runs.

The toy example above is easy to spot because the "cmds" are
all the same length, but real code is much more complicated.
It's also difficult to detect these situations by statically
analyzing the shell code with regexps (like the
check-non-portable-shell script does); there's too much
context required to know whether a &&-chain is appropriate
on a given line or not.

This patch instead lets the shell check each test by
sticking a command with a specific and unusual return code
at the top of each test, like:

  (exit 117) &&
  cmd1 &&
  cmd2
  cmd3

In a well-formed test, the non-zero exit from the first
command prevents any of the rest from being run, and the
test's exit code is 117. In a bad test (like the one above),
the 117 is lost, and cmd3 is run.

When we encounter a failure of this check, we abort the test
script entirely. For one thing, we have no clue which subset
of the commands in the test snippet were actually run.
Running further tests would be pointless, because we're now
in an unknown state. And two, this is not a "test failure"
in the traditional sense. The test script is buggy, not the
code it is testing. We should be able to fix these problems
in the script once, and not have them come back later as a
regression in git's code.

After checking a test snippet for --chain-lint, we do still
run the test itself.  We could actually have a pure-lint
mode which just checks each test, but there are a few
reasons not to. One, because the tests are executing
arbitrary code, which could impact the later environment
(e.g., that could impact which set of tests we run at all).
And two, because a pure-lint mode would still be expensive
to run, because a significant amount of code runs outside of
the test_expect_* blocks.  Instead, this option is designed
to be used as part of a normal test suite run, where it adds
very little overhead.

Turning on this option detects quite a few problems in
existing tests, which will be fixed in subsequent patches.
However, there are a number of places it cannot reach:

 - it cannot find a failure to break out of loops on error,
   like:

     cmd1 &&
     for i in a b c; do
     cmd2 $i
     done &&
     cmd3

   which will not notice failures of "cmd2 a" or "cmd b"

 - it cannot find a missing &&-chain inside a block or
   subfunction, like:

     foo () {
     cmd1
     cmd2
     }

     foo &&
     bar

   which will not notice a failure of cmd1.

 - it only checks tests that you run; every platform will
   have some tests skipped due to missing prequisites,
   so it's impossible to say from one run that the test
   suite is free of broken &&-chains. However, all tests get
   run by _somebody_, so eventually we will notice problems.

 - it does not operate on test_when_finished or prerequisite
   blocks. It could, but these tends to be much shorter and
   less of a problem, so I punted on them in this patch.

This patch was inspired by an earlier patch by Jonathan
Nieder:

  http://article.gmane.org/gmane.comp.version-control.git/235913

This implementation and all bugs are mine.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoPost 2.3 cyce (batch #10)
Junio C Hamano [Tue, 17 Mar 2015 23:05:12 +0000 (16:05 -0700)]
Post 2.3 cyce (batch #10)

Also declare that the next one will be called v2.4 ;-)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'mg/doc-status-color-slot'
Junio C Hamano [Tue, 17 Mar 2015 23:01:34 +0000 (16:01 -0700)]
Merge branch 'mg/doc-status-color-slot'

Documentation fixes.

* mg/doc-status-color-slot:
  config,completion: add color.status.unmerged

9 years agoMerge branch 'mg/status-v-v'
Junio C Hamano [Tue, 17 Mar 2015 23:01:33 +0000 (16:01 -0700)]
Merge branch 'mg/status-v-v'

"git status" now allows the "-v" to be given twice to show the
differences that are left in the working tree not to be committed.

* mg/status-v-v:
  commit/status: show the index-worktree diff with -v -v
  t7508: test git status -v
  t7508: .gitignore 'expect' and 'output' files

9 years agoMerge branch 'mg/sequencer-commit-messages-always-verbatim'
Junio C Hamano [Tue, 17 Mar 2015 23:01:31 +0000 (16:01 -0700)]
Merge branch 'mg/sequencer-commit-messages-always-verbatim'

"git cherry-pick" used to clean-up the log message even when it is
merely replaying an existing commit.  It now replays the message
verbatim unless you are editing the message of resulting commits.

* mg/sequencer-commit-messages-always-verbatim:
  sequencer: preserve commit messages

9 years agoMerge branch 'sg/completion-remote'
Junio C Hamano [Tue, 17 Mar 2015 23:01:30 +0000 (16:01 -0700)]
Merge branch 'sg/completion-remote'

Code simplification.

* sg/completion-remote:
  completion: simplify __git_remotes()
  completion: add a test for __git_remotes() helper function

9 years agoMerge branch 'es/rebase-i-count-todo'
Junio C Hamano [Tue, 17 Mar 2015 23:01:29 +0000 (16:01 -0700)]
Merge branch 'es/rebase-i-count-todo'

"git rebase -i" recently started to include the number of
commits in the insn sheet to be processed, but on a platform
that prepends leading whitespaces to "wc -l" output, the numbers
are shown with extra whitespaces that aren't necessary.

* es/rebase-i-count-todo:
  rebase-interactive: re-word "item count" comment
  rebase-interactive: suppress whitespace preceding item count

9 years agoMerge branch 'ak/git-done-help-cleanup'
Junio C Hamano [Tue, 17 Mar 2015 23:01:28 +0000 (16:01 -0700)]
Merge branch 'ak/git-done-help-cleanup'

Code simplification.

* ak/git-done-help-cleanup:
  git: make was_alias and done_help non-static

9 years agoMerge branch 'rs/zip-text'
Junio C Hamano [Tue, 17 Mar 2015 23:01:27 +0000 (16:01 -0700)]
Merge branch 'rs/zip-text'

"git archive" can now be told to set the 'text' attribute in the
resulting zip archive.

* rs/zip-text:
  archive-zip: mark text files in archives

9 years agoMerge branch 'rs/deflate-init-cleanup'
Junio C Hamano [Tue, 17 Mar 2015 23:01:26 +0000 (16:01 -0700)]
Merge branch 'rs/deflate-init-cleanup'

Code simplification.

* rs/deflate-init-cleanup:
  zlib: initialize git_zstream in git_deflate_init{,_gzip,_raw}

9 years agoSync with 2.3.3
Junio C Hamano [Sat, 14 Mar 2015 06:11:50 +0000 (23:11 -0700)]
Sync with 2.3.3

9 years agoGit 2.3.3 v2.3.3
Junio C Hamano [Sat, 14 Mar 2015 05:57:25 +0000 (22:57 -0700)]
Git 2.3.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'mr/doc-clean-f-f' into maint
Junio C Hamano [Sat, 14 Mar 2015 05:56:12 +0000 (22:56 -0700)]
Merge branch 'mr/doc-clean-f-f' into maint

Documentation update.

* mr/doc-clean-f-f:
  Documentation/git-clean.txt: document that -f may need to be given twice

9 years agoMerge branch 'ak/t5516-typofix' into maint
Junio C Hamano [Sat, 14 Mar 2015 05:56:11 +0000 (22:56 -0700)]
Merge branch 'ak/t5516-typofix' into maint

* ak/t5516-typofix:
  t5516: correct misspelled pushInsteadOf

9 years agoMerge branch 'jc/diff-test-updates' into maint
Junio C Hamano [Sat, 14 Mar 2015 05:56:09 +0000 (22:56 -0700)]
Merge branch 'jc/diff-test-updates' into maint

Test clean-up.

* jc/diff-test-updates:
  test_ln_s_add: refresh stat info of fake symbolic links
  t4008: modernise style
  t/diff-lib: check exact object names in compare_diff_raw
  tests: do not borrow from COPYING and README from the real source
  t4010: correct expected object names
  t9300: correct expected object names
  t4008: correct stale comments

9 years agoMerge branch 'jk/diffcore-rename-duplicate' into maint
Junio C Hamano [Sat, 14 Mar 2015 05:56:08 +0000 (22:56 -0700)]
Merge branch 'jk/diffcore-rename-duplicate' into maint

A corrupt input to "git diff -M" can cause us to segfault.

* jk/diffcore-rename-duplicate:
  diffcore-rename: avoid processing duplicate destinations
  diffcore-rename: split locate_rename_dst into two functions

9 years agoMerge branch 'bw/kwset-use-unsigned' into maint
Junio C Hamano [Sat, 14 Mar 2015 05:56:07 +0000 (22:56 -0700)]
Merge branch 'bw/kwset-use-unsigned' into maint

The borrowed code in kwset API did not follow our usual convention
to use "unsigned char" to store values that range from 0-255.

* bw/kwset-use-unsigned:
  kwset: use unsigned char to store values with high-bit set

9 years agoMerge branch 'nd/grep-exclude-standard-help-fix' into maint
Junio C Hamano [Sat, 14 Mar 2015 05:56:06 +0000 (22:56 -0700)]
Merge branch 'nd/grep-exclude-standard-help-fix' into maint

Description given by "grep -h" for its --exclude-standard option
was phrased poorly.

* nd/grep-exclude-standard-help-fix:
  grep: correct help string for --exclude-standard

9 years agoMerge branch 'mg/doc-remote-tags-or-not' into maint
Junio C Hamano [Sat, 14 Mar 2015 05:56:05 +0000 (22:56 -0700)]
Merge branch 'mg/doc-remote-tags-or-not' into maint

"git remote add" mentioned "--tags" and "--no-tags" and was not
clear that fetch from the remote in the future will use the default
behaviour when neither is given to override it.

* mg/doc-remote-tags-or-not:
  git-remote.txt: describe behavior without --tags and --no-tags

9 years agoMerge branch 'mk/diff-shortstat-dirstat-fix' into maint
Junio C Hamano [Sat, 14 Mar 2015 05:56:04 +0000 (22:56 -0700)]
Merge branch 'mk/diff-shortstat-dirstat-fix' into maint

"git diff --shortstat --dirstat=changes" showed a dirstat based on
lines that was never asked by the end user in addition to the
dirstat that the user asked for.

* mk/diff-shortstat-dirstat-fix:
  diff --shortstat --dirstat: remove duplicate output

9 years agoMerge branch 'ms/submodule-update-config-doc' into maint
Junio C Hamano [Sat, 14 Mar 2015 05:56:03 +0000 (22:56 -0700)]
Merge branch 'ms/submodule-update-config-doc' into maint

The interaction between "git submodule update" and the
submodule.*.update configuration was not clearly documented.

* ms/submodule-update-config-doc:
  submodule: improve documentation of update subcommand

9 years agoMerge branch 'jc/apply-beyond-symlink' into maint
Junio C Hamano [Sat, 14 Mar 2015 05:56:02 +0000 (22:56 -0700)]
Merge branch 'jc/apply-beyond-symlink' into maint

"git apply" was not very careful about reading from, removing,
updating and creating paths outside the working tree (under
--index/--cached) or the current directory (when used as a
replacement for GNU patch).

* jc/apply-beyond-symlink:
  apply: do not touch a file beyond a symbolic link
  apply: do not read from beyond a symbolic link
  apply: do not read from the filesystem under --index
  apply: reject input that touches outside the working area

9 years agoMerge branch 'rs/daemon-interpolate' into maint
Junio C Hamano [Sat, 14 Mar 2015 05:56:00 +0000 (22:56 -0700)]
Merge branch 'rs/daemon-interpolate' into maint

"git daemon" looked up the hostname even when "%CH" and "%IP"
interpolations are not requested, which was unnecessary.

* rs/daemon-interpolate:
  daemon: use callback to build interpolated path
  daemon: look up client-supplied hostname lazily

9 years agoMerge branch 'jk/daemon-interpolate' into maint
Junio C Hamano [Sat, 14 Mar 2015 05:55:59 +0000 (22:55 -0700)]
Merge branch 'jk/daemon-interpolate' into maint

The "interpolated-path" option of "git daemon" inserted any string
client declared on the "host=" capability request without checking.
Sanitize and limit %H and %CH to a saner and a valid DNS name.

* jk/daemon-interpolate:
  daemon: sanitize incoming virtual hostname
  t5570: test git-daemon's --interpolated-path option
  git_connect: let user override virtual-host we send to daemon

9 years agoconfig,completion: add color.status.unmerged
Michael J Gruber [Tue, 10 Mar 2015 16:11:09 +0000 (17:11 +0100)]
config,completion: add color.status.unmerged

Reported-by: "Mladen B." <mladen074@gmail.com>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoPost 2.3 cycle (batch #9)
Junio C Hamano [Tue, 10 Mar 2015 20:53:49 +0000 (13:53 -0700)]
Post 2.3 cycle (batch #9)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'mh/expire-updateref-fixes'
Junio C Hamano [Tue, 10 Mar 2015 20:52:39 +0000 (13:52 -0700)]
Merge branch 'mh/expire-updateref-fixes'

Various issues around "reflog expire", e.g. using --updateref when
expiring a reflog for a symbolic reference, have been corrected
and/or made saner.

* mh/expire-updateref-fixes:
  reflog_expire(): never update a reference to null_sha1
  reflog_expire(): ignore --updateref for symbolic references
  reflog: improve and update documentation
  struct ref_lock: delete the force_write member
  lock_ref_sha1_basic(): do not set force_write for missing references
  write_ref_sha1(): move write elision test to callers
  write_ref_sha1(): remove check for lock == NULL

9 years agoMerge branch 'jk/diffcore-rename-duplicate'
Junio C Hamano [Tue, 10 Mar 2015 20:52:38 +0000 (13:52 -0700)]
Merge branch 'jk/diffcore-rename-duplicate'

A corrupt input to "git diff -M" can cause us to segfault.

* jk/diffcore-rename-duplicate:
  diffcore-rename: avoid processing duplicate destinations
  diffcore-rename: split locate_rename_dst into two functions

9 years agoPost 2.3 cycle (batch #8)
Junio C Hamano [Fri, 6 Mar 2015 23:05:39 +0000 (15:05 -0800)]
Post 2.3 cycle (batch #8)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'bw/kwset-use-unsigned'
Junio C Hamano [Fri, 6 Mar 2015 23:02:33 +0000 (15:02 -0800)]
Merge branch 'bw/kwset-use-unsigned'

The borrowed code in kwset API did not follow our usual convention
to use "unsigned char" to store values that range from 0-255.

* bw/kwset-use-unsigned:
  kwset: use unsigned char to store values with high-bit set

9 years agoMerge branch 'ak/t5516-typofix'
Junio C Hamano [Fri, 6 Mar 2015 23:02:32 +0000 (15:02 -0800)]
Merge branch 'ak/t5516-typofix'

* ak/t5516-typofix:
  t5516: correct misspelled pushInsteadOf

9 years agoMerge branch 'ms/submodule-update-config-doc'
Junio C Hamano [Fri, 6 Mar 2015 23:02:31 +0000 (15:02 -0800)]
Merge branch 'ms/submodule-update-config-doc'

The interaction between "git submodule update" and the
submodule.*.update configuration was not clearly documented.

* ms/submodule-update-config-doc:
  submodule: improve documentation of update subcommand

9 years agoMerge branch 'ja/clean-confirm-i18n'
Junio C Hamano [Fri, 6 Mar 2015 23:02:29 +0000 (15:02 -0800)]
Merge branch 'ja/clean-confirm-i18n'

The prompt string "remove?" used when "git clean -i" asks the user
if a path should be removed was localizable, but the code always
expects a substring of "yes" to tell it to go ahead.  Always show
[y/N] as part of this prompt to hint that the answer is not (yet)
localized.

* ja/clean-confirm-i18n:
  Add hint interactive cleaning

9 years agoMerge branch 'mk/diff-shortstat-dirstat-fix'
Junio C Hamano [Fri, 6 Mar 2015 23:02:28 +0000 (15:02 -0800)]
Merge branch 'mk/diff-shortstat-dirstat-fix'

"git diff --shortstat --dirstat=changes" showed a dirstat based on
lines that was never asked by the end user in addition to the
dirstat that the user asked for.

* mk/diff-shortstat-dirstat-fix:
  diff --shortstat --dirstat: remove duplicate output

9 years agoMerge branch 'mg/doc-remote-tags-or-not'
Junio C Hamano [Fri, 6 Mar 2015 23:02:27 +0000 (15:02 -0800)]
Merge branch 'mg/doc-remote-tags-or-not'

"git remote add" mentioned "--tags" and "--no-tags" and was not
clear that fetch from the remote in the future will use the default
behaviour when neither is given to override it.

* mg/doc-remote-tags-or-not:
  git-remote.txt: describe behavior without --tags and --no-tags

9 years agoMerge branch 'nd/grep-exclude-standard-help-fix'
Junio C Hamano [Fri, 6 Mar 2015 23:02:27 +0000 (15:02 -0800)]
Merge branch 'nd/grep-exclude-standard-help-fix'

Description given by "grep -h" for its --exclude-standard option
was phrased poorly.

* nd/grep-exclude-standard-help-fix:
  grep: correct help string for --exclude-standard

9 years agoMerge branch 'mr/doc-clean-f-f'
Junio C Hamano [Fri, 6 Mar 2015 23:02:26 +0000 (15:02 -0800)]
Merge branch 'mr/doc-clean-f-f'

Documentation update.

* mr/doc-clean-f-f:
  Documentation/git-clean.txt: document that -f may need to be given twice

9 years agoMerge branch 'ye/http-accept-language'
Junio C Hamano [Fri, 6 Mar 2015 23:02:24 +0000 (15:02 -0800)]
Merge branch 'ye/http-accept-language'

Compilation fix for a recent topic in 'master'.

* ye/http-accept-language:
  gettext.c: move get_preferred_languages() from http.c

9 years agoSync with 2.3.2
Junio C Hamano [Fri, 6 Mar 2015 22:59:12 +0000 (14:59 -0800)]
Sync with 2.3.2

* maint:
  Git 2.3.2

9 years agoGit 2.3.2 v2.3.2
Junio C Hamano [Fri, 6 Mar 2015 22:58:14 +0000 (14:58 -0800)]
Git 2.3.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'rj/no-xopen-source-for-cygwin' into maint
Junio C Hamano [Fri, 6 Mar 2015 22:57:58 +0000 (14:57 -0800)]
Merge branch 'rj/no-xopen-source-for-cygwin' into maint

Code cleanups.

* rj/no-xopen-source-for-cygwin:
  git-compat-util.h: remove redundant code

9 years agoMerge branch 'rs/simple-cleanups' into maint
Junio C Hamano [Fri, 6 Mar 2015 22:57:57 +0000 (14:57 -0800)]
Merge branch 'rs/simple-cleanups' into maint

Code cleanups.

* rs/simple-cleanups:
  sha1_name: use strlcpy() to copy strings
  pretty: use starts_with() to check for a prefix
  for-each-ref: use skip_prefix() to avoid duplicate string comparison
  connect: use strcmp() for string comparison

9 years agoMerge branch 'mm/am-c-doc' into maint
Junio C Hamano [Fri, 6 Mar 2015 22:57:56 +0000 (14:57 -0800)]
Merge branch 'mm/am-c-doc' into maint

The configuration variable 'mailinfo.scissors' was hard to
discover in the documentation.

* mm/am-c-doc:
  Documentation/git-am.txt: mention mailinfo.scissors config variable
  Documentation/config.txt: document mailinfo.scissors

9 years agoMerge branch 'ew/svn-maint-fixes' into maint
Junio C Hamano [Fri, 6 Mar 2015 22:57:55 +0000 (14:57 -0800)]
Merge branch 'ew/svn-maint-fixes' into maint

Correct a breakage to git-svn around v2.2 era that triggers
premature closing of FileHandle.

* ew/svn-maint-fixes:
  Git::SVN::*: avoid premature FileHandle closure
  git-svn: fix localtime=true on non-glibc environments

9 years agoMerge branch 'km/send-email-getopt-long-workarounds' into maint
Junio C Hamano [Fri, 6 Mar 2015 22:57:54 +0000 (14:57 -0800)]
Merge branch 'km/send-email-getopt-long-workarounds' into maint

Even though we officially haven't dropped Perl 5.8 support, the
Getopt::Long package that came with it does not support "--no-"
prefix to negate a boolean option; manually add support to help
people with older Getopt::Long package.

* km/send-email-getopt-long-workarounds:
  git-send-email.perl: support no- prefix with older GetOptions

9 years agocompletion: simplify __git_remotes()
SZEDER Gábor [Wed, 4 Mar 2015 14:10:29 +0000 (15:10 +0100)]
completion: simplify __git_remotes()

The __git_remotes() helper function lists the remotes from the config
file by processing the output of a 'git config' query.  A simple 'git
remote' produces the exact same output, so run that instead.

Remotes under '$GIT_DIR/remotes' are still listed by running 'ls -1',
because 'git remote' unfortunately ignores them.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocompletion: add a test for __git_remotes() helper function
SZEDER Gábor [Wed, 4 Mar 2015 14:10:28 +0000 (15:10 +0100)]
completion: add a test for __git_remotes() helper function

The test checks that both remotes under '$GIT_DIR/remotes' and remotes
in the config file are listed.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agorebase-interactive: re-word "item count" comment
Eric Sunshine [Wed, 4 Mar 2015 07:53:05 +0000 (02:53 -0500)]
rebase-interactive: re-word "item count" comment

97f05f43 (Show number of TODO items for interactive rebase, 2014-12-10)
taught rebase-interactive to display an item count in the instruction
list comments:

    # Rebase 46640c6..5568fd5 onto 46640c6 (4 TODO item(s))
    #
    # Commands:
    # p, pick = use commit
    # ...

However, with the exception of the --edit-todo option, "TODO" is a
one-off term, never presented to the user by rebase-interactive in
any other context. The item count is in fact the number of commands
("pick", "edit", etc.) remaining on the instruction sheet, and the
comment immediately following it talks about "Commands". Consequently,
replace "(# TODO item(s))" with the more accurate and meaningful
"(# command(s))".

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agorebase-interactive: suppress whitespace preceding item count
Eric Sunshine [Wed, 4 Mar 2015 07:53:04 +0000 (02:53 -0500)]
rebase-interactive: suppress whitespace preceding item count

97f05f43 (Show number of TODO items for interactive rebase, 2014-12-10)
taught rebase-interactive to compute an item count with 'wc -l' and
display it in the instruction list comments:

    # Rebase 46640c6..5568fd5 onto 46640c6 (4 TODO item(s))

On Mac OS X, however, it renders as:

    # Rebase 46640c6..5568fd5 onto 46640c6 (       4 TODO item(s))

since 'wc -l' indents its output with leading spaces. Fix this.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agogit: make was_alias and done_help non-static
Alexander Kuleshov [Mon, 2 Mar 2015 12:02:37 +0000 (18:02 +0600)]
git: make was_alias and done_help non-static

'was_alias' variable does not need to store it's value on each
iteration in the loop; this variable gets assigned the result
of run_argv() every time in the loop before being used.

'done_help' variable does not need to be static variable too if
we move it out the loop.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agosequencer: preserve commit messages
Michael J Gruber [Fri, 6 Mar 2015 13:55:32 +0000 (14:55 +0100)]
sequencer: preserve commit messages

sequencer calls "commit" with default options, which implies
"--cleanup=default" unless the user specified something else in their
config. This leads to cherry-picked commits getting a cleaned up commit
message, which is usually not an intended side-effect.

Make the sequencer use "--cleanup=verbatim" so that it preserves commit
messages independent of the default, unless the user has set config for "commit"
or the message is amended with -s or -x.

Reported-by: Christoph Anton Mitterer <calestyo@scientia.net>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocommit/status: show the index-worktree diff with -v -v
Michael J Gruber [Fri, 6 Mar 2015 09:43:35 +0000 (10:43 +0100)]
commit/status: show the index-worktree diff with -v -v

git commit and git status in long format show the diff between HEAD
and the index when given -v. This allows previewing a commit to be made.

They also list tracked files with unstaged changes, but without a diff.

Introduce '-v -v' which shows the diff between the index and the
worktree in addition to the HEAD index diff. This allows a review of unstaged
changes which might be missing from the commit.

In the case of '-v -v', additonal header lines

Changes to be committed:

and

Changes not staged for commit:

are inserted before the diffs, which are equal to those in the status
part; the latter preceded by 50*"-" to make it stick out more.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot7508: test git status -v
Michael J Gruber [Fri, 6 Mar 2015 09:43:34 +0000 (10:43 +0100)]
t7508: test git status -v

"status -v" had no test. Include one.

This also requires changing the .gitignore subtests, which is a good thing:
they include testing a .gitignore pattern now.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot7508: .gitignore 'expect' and 'output' files
Junio C Hamano [Fri, 6 Mar 2015 09:43:33 +0000 (10:43 +0100)]
t7508: .gitignore 'expect' and 'output' files

These files are used to observe the behaviour of the 'status'
command and if there weren't any such observer, the expected
output from 'status' wouldn't even mention them.

Place them in .gitignore to unclutter the output expected by the
tests.  An added benefit is that future tests can add such files
that are purely for use by the observer, i.e. the tests themselves,
by naming them as expect-foo and/or output-bar.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agozlib: initialize git_zstream in git_deflate_init{,_gzip,_raw}
René Scharfe [Thu, 5 Mar 2015 22:49:46 +0000 (23:49 +0100)]
zlib: initialize git_zstream in git_deflate_init{,_gzip,_raw}

Clear the git_zstream variable at the start of git_deflate_init() etc.
so that callers don't have to do that.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoarchive-zip: mark text files in archives
René Scharfe [Thu, 5 Mar 2015 19:06:02 +0000 (20:06 +0100)]
archive-zip: mark text files in archives

Set the text flag for ZIP archive entries that look like text files so
that unzip -a can be used to perform end-of-line conversions.  Info-ZIP
zip does the same.

Detect binary files the same way as git diff and git grep do, namely by
checking for the attribute "diff" and its negation "-diff", and if none
is found by falling back to checking for the presence of NUL bytes in
the first few bytes of the file contents.

7-Zip, Windows' built-in ZIP functionality and Info-ZIP unzip without
the switch -a are not affected by the change and still extract text
files without doing any end-of-line conversions.

NB: The actual end-of-line style used in the archive entries doesn't
matter to unzip -a, as it converts any CR, CRLF and LF to the line end
characters appropriate for the platform it is running on.

Suggested-by: Ulrike Fischer <luatex@nililand.de>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoSync with maint
Junio C Hamano [Thu, 5 Mar 2015 21:16:27 +0000 (13:16 -0800)]
Sync with maint

* maint:
  Prepare for 2.3.2

9 years agoPrepare for 2.3.2
Junio C Hamano [Thu, 5 Mar 2015 21:15:53 +0000 (13:15 -0800)]
Prepare for 2.3.2

9 years agoMerge branch 'sb/plug-leak-in-make-cache-entry' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:13:13 +0000 (13:13 -0800)]
Merge branch 'sb/plug-leak-in-make-cache-entry' into maint

"update-index --refresh" used to leak when an entry cannot be
refreshed for whatever reason.

* sb/plug-leak-in-make-cache-entry:
  read-cache.c: free cache entry when refreshing fails

9 years agoMerge branch 'jk/fast-import-die-nicely-fix' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:13:12 +0000 (13:13 -0800)]
Merge branch 'jk/fast-import-die-nicely-fix' into maint

"git fast-import" used to crash when it could not close and
conclude the resulting packfile cleanly.

* jk/fast-import-die-nicely-fix:
  fast-import: avoid running end_packfile recursively

9 years agoMerge branch 'es/blame-commit-info-fix' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:13:12 +0000 (13:13 -0800)]
Merge branch 'es/blame-commit-info-fix' into maint

"git blame" died, trying to free an uninitialized piece of memory.

* es/blame-commit-info-fix:
  builtin/blame: destroy initialized commit_info only

9 years agoMerge branch 'ab/merge-file-prefix' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:13:10 +0000 (13:13 -0800)]
Merge branch 'ab/merge-file-prefix' into maint

"git merge-file" did not work correctly in a subdirectory.

* ab/merge-file-prefix:
  merge-file: correctly open files when in a subdir

9 years agoMerge branch 'ps/submodule-sanitize-path-upon-add' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:13:09 +0000 (13:13 -0800)]
Merge branch 'ps/submodule-sanitize-path-upon-add' into maint

"git submodule add" failed to squash "path/to/././submodule" to
"path/to/submodule".

* ps/submodule-sanitize-path-upon-add:
  git-submodule.sh: fix '/././' path normalization

9 years agoMerge branch 'jk/prune-mtime' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:13:08 +0000 (13:13 -0800)]
Merge branch 'jk/prune-mtime' into maint

In v2.2.0, we broke "git prune" that runs in a repository that
borrows from an alternate object store.

* jk/prune-mtime:
  sha1_file: fix iterating loose alternate objects
  for_each_loose_file_in_objdir: take an optional strbuf path

9 years agoMerge branch 'tc/curl-vernum-output-broken-in-7.11' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:13:07 +0000 (13:13 -0800)]
Merge branch 'tc/curl-vernum-output-broken-in-7.11' into maint

Certain older vintages of cURL give irregular output from
"curl-config --vernum", which confused our build system.

* tc/curl-vernum-output-broken-in-7.11:
  Makefile: handle broken curl version number in version check

9 years agoMerge branch 'es/squelch-openssl-warnings-on-macosx' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:13:06 +0000 (13:13 -0800)]
Merge branch 'es/squelch-openssl-warnings-on-macosx' into maint

An earlier workaround to squelch unhelpful deprecation warnings
from the complier on Mac OSX unnecessarily set minimum required
version of the OS, which the user might want to raise (or lower)
for other reasons.

* es/squelch-openssl-warnings-on-macosx:
  git-compat-util: do not step on MAC_OS_X_VERSION_MIN_REQUIRED

9 years agoMerge branch 'jc/conf-var-doc' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:13:05 +0000 (13:13 -0800)]
Merge branch 'jc/conf-var-doc' into maint

Longstanding configuration variable naming rules has been added to
the documentation.

* jc/conf-var-doc:
  CodingGuidelines: describe naming rules for configuration variables
  config.txt: mark deprecated variables more prominently
  config.txt: clarify that add.ignore-errors is deprecated

9 years agoMerge branch 'av/wincred-with-at-in-username-fix' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:13:04 +0000 (13:13 -0800)]
Merge branch 'av/wincred-with-at-in-username-fix' into maint

The credential helper for Windows (in contrib/) used to mishandle
a user name with an at-sign in it.

* av/wincred-with-at-in-username-fix:
  wincred: fix get credential if username has "@"

9 years agoMerge branch 'ch/new-gpg-drops-rfc-1991' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:13:03 +0000 (13:13 -0800)]
Merge branch 'ch/new-gpg-drops-rfc-1991' into maint

Older GnuPG implementations may not correctly import the keyring
material we prepare for the tests to use.

* ch/new-gpg-drops-rfc-1991:
  t/lib-gpg: sanity-check that we can actually sign
  t/lib-gpg: include separate public keys in keyring.gpg

9 years agoMerge branch 'jc/remote-set-url-doc' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:13:03 +0000 (13:13 -0800)]
Merge branch 'jc/remote-set-url-doc' into maint

Clarify in the documentation that "remote.<nick>.pushURL" and
"remote.<nick>.URL" are there to name the same repository accessed
via different transports, not two separate repositories.

* jc/remote-set-url-doc:
  Documentation/git-remote.txt: stress that set-url is not for triangular

9 years agoMerge branch 'jk/pack-bitmap' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:13:02 +0000 (13:13 -0800)]
Merge branch 'jk/pack-bitmap' into maint

The pack bitmap support did not build with older versions of GCC.

* jk/pack-bitmap:
  ewah: fix building with gcc < 3.4.0

9 years agoMerge branch 'jk/config-no-ungetc-eof' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:13:00 +0000 (13:13 -0800)]
Merge branch 'jk/config-no-ungetc-eof' into maint

Reading configuration from a blob object, when it ends with a lone
CR, use to confuse the configuration parser.

* jk/config-no-ungetc-eof:
  config_buf_ungetc: warn when pushing back a random character
  config: do not ungetc EOF

9 years agoMerge branch 'jk/decimal-width-for-uintmax' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:12:59 +0000 (13:12 -0800)]
Merge branch 'jk/decimal-width-for-uintmax' into maint

We didn't format an integer that wouldn't fit in "int" but in
"uintmax_t" correctly.

* jk/decimal-width-for-uintmax:
  decimal_width: avoid integer overflow

9 years agoMerge branch 'jc/push-cert' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:12:58 +0000 (13:12 -0800)]
Merge branch 'jc/push-cert' into maint

"git push --signed" gave an incorrectly worded error message when
the other side did not support the capability.

* jc/push-cert:
  transport-helper: fix typo in error message when --signed is not supported

9 years agoMerge branch 'mh/deref-symref-over-helper-transport' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:12:57 +0000 (13:12 -0800)]
Merge branch 'mh/deref-symref-over-helper-transport' into maint

"git fetch" over a remote-helper that cannot respond to "list"
command could not fetch from a symbolic reference e.g. HEAD.

* mh/deref-symref-over-helper-transport:
  transport-helper: do not request symbolic refs to remote helpers

9 years agoMerge branch 'ks/rebase-i-abbrev' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:12:56 +0000 (13:12 -0800)]
Merge branch 'ks/rebase-i-abbrev' into maint

The insn sheet "git rebase -i" creates did not fully honor
core.abbrev settings.

* ks/rebase-i-abbrev:
  rebase -i: use full object name internally throughout the script

9 years agoMerge branch 'dp/remove-duplicated-header-inclusion' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:12:55 +0000 (13:12 -0800)]
Merge branch 'dp/remove-duplicated-header-inclusion' into maint

Code clean-up.

* dp/remove-duplicated-header-inclusion:
  do not include the same header twice

9 years agoMerge branch 'sb/hex-object-name-is-at-most-41-bytes-long' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:12:54 +0000 (13:12 -0800)]
Merge branch 'sb/hex-object-name-is-at-most-41-bytes-long' into maint

Code clean-up.

* sb/hex-object-name-is-at-most-41-bytes-long:
  hex.c: reduce memory footprint of sha1_to_hex static buffers

9 years agoMerge branch 'ak/git-pm-typofix' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:12:53 +0000 (13:12 -0800)]
Merge branch 'ak/git-pm-typofix' into maint

Typofix in comments.

* ak/git-pm-typofix:
  Git.pm: two minor typo fixes

9 years agoMerge branch 'jk/sanity' into maint
Junio C Hamano [Thu, 5 Mar 2015 21:12:52 +0000 (13:12 -0800)]
Merge branch 'jk/sanity' into maint

The tests that wanted to see that file becomes unreadable after
running "chmod a-r file", and the tests that wanted to make sure it
is not run as root, we used "can we write into the / directory?" as
a cheap substitute, but on some platforms that is not a good
heuristics.  The tests and their prerequisites have been updated to
check what they really require.

* jk/sanity:
  test-lib.sh: set prerequisite SANITY by testing what we really need
  tests: correct misuses of POSIXPERM
  t/lib-httpd: switch SANITY check for NOT_ROOT

9 years agoPost 2.3 cycle (batch #7)
Junio C Hamano [Thu, 5 Mar 2015 20:48:18 +0000 (12:48 -0800)]
Post 2.3 cycle (batch #7)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'ew/svn-fixes'
Junio C Hamano [Thu, 5 Mar 2015 20:45:45 +0000 (12:45 -0800)]
Merge branch 'ew/svn-fixes'

* ew/svn-fixes:
  git-svn: lazy load some modules

9 years agoMerge branch 'ew/svn-maint-fixes'
Junio C Hamano [Thu, 5 Mar 2015 20:45:45 +0000 (12:45 -0800)]
Merge branch 'ew/svn-maint-fixes'

Correct a breakage to git-svn around v2.2 era that triggers
premature closing of FileHandle.

* ew/svn-maint-fixes:
  Git::SVN::*: avoid premature FileHandle closure
  git-svn: fix localtime=true on non-glibc environments

9 years agoMerge branch 'tb/connect-ipv6-parse-fix'
Junio C Hamano [Thu, 5 Mar 2015 20:45:44 +0000 (12:45 -0800)]
Merge branch 'tb/connect-ipv6-parse-fix'

We did not parse username followed by literal IPv6 address in SSH
transport URLs, e.g. ssh://user@[2001:db8::1]:22/repo.git
correctly.

* tb/connect-ipv6-parse-fix:
  t5500: show user name and host in diag-url
  t5601: add more test cases for IPV6
  connect.c: allow ssh://user@[2001:db8::1]/repo.git

9 years agoMerge branch 'jc/diff-test-updates'
Junio C Hamano [Thu, 5 Mar 2015 20:45:43 +0000 (12:45 -0800)]
Merge branch 'jc/diff-test-updates'

Test clean-up.

* jc/diff-test-updates:
  test_ln_s_add: refresh stat info of fake symbolic links
  t4008: modernise style
  t/diff-lib: check exact object names in compare_diff_raw
  tests: do not borrow from COPYING and README from the real source
  t4010: correct expected object names
  t9300: correct expected object names
  t4008: correct stale comments

9 years agoMerge branch 'rs/simple-cleanups'
Junio C Hamano [Thu, 5 Mar 2015 20:45:42 +0000 (12:45 -0800)]
Merge branch 'rs/simple-cleanups'

Code cleanups.

* rs/simple-cleanups:
  sha1_name: use strlcpy() to copy strings
  pretty: use starts_with() to check for a prefix
  for-each-ref: use skip_prefix() to avoid duplicate string comparison
  connect: use strcmp() for string comparison

9 years agoMerge branch 'rj/no-xopen-source-for-cygwin'
Junio C Hamano [Thu, 5 Mar 2015 20:45:41 +0000 (12:45 -0800)]
Merge branch 'rj/no-xopen-source-for-cygwin'

Code cleanups.

* rj/no-xopen-source-for-cygwin:
  git-compat-util.h: remove redundant code

9 years agoMerge branch 'mm/am-c-doc'
Junio C Hamano [Thu, 5 Mar 2015 20:45:40 +0000 (12:45 -0800)]
Merge branch 'mm/am-c-doc'

The configuration variable 'mailinfo.scissors' was hard to
discover in the documentation.

* mm/am-c-doc:
  Documentation/git-am.txt: mention mailinfo.scissors config variable
  Documentation/config.txt: document mailinfo.scissors

9 years agoMerge branch 'mh/refs-have-new'
Junio C Hamano [Thu, 5 Mar 2015 20:45:39 +0000 (12:45 -0800)]
Merge branch 'mh/refs-have-new'

Simplify the ref transaction API around how "the ref should be
pointing at this object" is specified.

* mh/refs-have-new:
  refs.h: remove duplication in function docstrings
  update_ref(): improve documentation
  ref_transaction_verify(): new function to check a reference's value
  ref_transaction_delete(): check that old_sha1 is not null_sha1
  ref_transaction_create(): check that new_sha1 is valid
  commit: avoid race when creating orphan commits
  commit: add tests of commit races
  ref_transaction_delete(): remove "have_old" parameter
  ref_transaction_update(): remove "have_old" parameter
  struct ref_update: move "have_old" into "flags"
  refs.c: change some "flags" to "unsigned int"
  refs: remove the gap in the REF_* constant values
  refs: move REF_DELETING to refs.c

9 years agoreflog_expire(): never update a reference to null_sha1
Michael Haggerty [Tue, 3 Mar 2015 11:43:17 +0000 (12:43 +0100)]
reflog_expire(): never update a reference to null_sha1

Currently, if --updateref is specified and the very last reflog entry
is expired or deleted, the reference's value is set to 0{40}. This is
an invalid state of the repository, and breaks, for example, "git
fsck" and "git for-each-ref".

The only place we use --updateref in our own code is when dropping
stash entries. In that code, the very next step is to check if the
reflog has been made empty, and if so, delete the "refs/stash"
reference entirely. Thus that code path ultimately leaves the
repository in a valid state.

But we don't want to the repository in an invalid state even
temporarily, and we don't want to leave an invalid state if other
callers of "git reflog expire|delete --updateref" don't think to do
the extra cleanup step.

So, if "git reflog expire|delete" leaves no more entries in the
reflog, just leave the reference unchanged.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoreflog_expire(): ignore --updateref for symbolic references
Michael Haggerty [Tue, 3 Mar 2015 11:43:16 +0000 (12:43 +0100)]
reflog_expire(): ignore --updateref for symbolic references

If we are expiring reflog entries for a symbolic reference, then how
should --updateref be handled if the newest reflog entry is expired?

Option 1: Update the referred-to reference. (This is what the current
code does.) This doesn't make sense, because the referred-to reference
has its own reflog, which hasn't been rewritten.

Option 2: Update the symbolic reference itself (as in, REF_NODEREF).
This would convert the symbolic reference into a non-symbolic
reference (e.g., detaching HEAD), which is surely not what a user
would expect.

Option 3: Error out. This is plausible, but it would make the
following usage impossible:

    git reflog expire ... --updateref --all

Option 4: Ignore --updateref for symbolic references.

We choose to implement option 4.

Note: another problem in this code will be fixed in a moment.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoreflog: improve and update documentation
Michael Haggerty [Tue, 3 Mar 2015 11:43:15 +0000 (12:43 +0100)]
reflog: improve and update documentation

Revamp the "git reflog" usage documentation in the manpage and the
command help to match the current reality and improve its clarity:

* Add documentation for some options that had been left out.

* Group the subcommands and options more logically and move more
  common subcommands/options higher.

* Improve some explanations.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agostruct ref_lock: delete the force_write member
Stefan Beller [Tue, 3 Mar 2015 11:43:14 +0000 (12:43 +0100)]
struct ref_lock: delete the force_write member

Instead, compute the value when it is needed.

Signed-off-by: Stefan Beller <sbeller@google.com>
Edited-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolock_ref_sha1_basic(): do not set force_write for missing references
Michael Haggerty [Mon, 2 Mar 2015 09:29:53 +0000 (10:29 +0100)]
lock_ref_sha1_basic(): do not set force_write for missing references

If a reference is missing, its SHA-1 will be null_sha1, which can't
possibly match a new value that ref_transaction_commit() is trying to
update it to. So there is no need to set force_write in this scenario.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agowrite_ref_sha1(): move write elision test to callers
Michael Haggerty [Mon, 2 Mar 2015 09:29:52 +0000 (10:29 +0100)]
write_ref_sha1(): move write elision test to callers

write_ref_sha1() previously skipped the write if the reference already
had the desired value, unless lock->force_write was set. Instead,
perform that test at the callers.

Two of the callers (in rename_ref()) unconditionally set force_write
just before calling write_ref_sha1(), so they don't need the extra
check at all. Nor do they need to set force_write anymore.

The last caller, in ref_transaction_commit(), still needs the test.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agowrite_ref_sha1(): remove check for lock == NULL
Michael Haggerty [Mon, 2 Mar 2015 09:29:51 +0000 (10:29 +0100)]
write_ref_sha1(): remove check for lock == NULL

None of the callers pass NULL to this function, and there doesn't seem
to be any usefulness to allowing them to do so.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoPost 2.3 cycle (batch #6)
Junio C Hamano [Tue, 3 Mar 2015 22:39:10 +0000 (14:39 -0800)]
Post 2.3 cycle (batch #6)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'jk/daemon-interpolate'
Junio C Hamano [Tue, 3 Mar 2015 22:37:05 +0000 (14:37 -0800)]
Merge branch 'jk/daemon-interpolate'

The "interpolated-path" option of "git daemon" inserted any string
client declared on the "host=" capability request without checking.
Sanitize and limit %H and %CH to a saner and a valid DNS name.

* jk/daemon-interpolate:
  daemon: sanitize incoming virtual hostname
  t5570: test git-daemon's --interpolated-path option
  git_connect: let user override virtual-host we send to daemon