gitweb.git
Merge branch 'es/format-patch-doc-hide-no-patch'Junio C Hamano Wed, 13 Apr 2016 21:12:35 +0000 (14:12 -0700)

Merge branch 'es/format-patch-doc-hide-no-patch'

"git format-patch --help" showed `-s` and `--no-patch` as if these
are valid options to the command. We already hide `--patch` option
from the documentation, because format-patch is about showing the
diff, and the documentation now hides these options as well.

* es/format-patch-doc-hide-no-patch:
git-format-patch.txt: don't show -s as shorthand for multiple options

Merge branch 'js/mingw-tests-2.8'Junio C Hamano Wed, 13 Apr 2016 21:12:34 +0000 (14:12 -0700)

Merge branch 'js/mingw-tests-2.8'

Code clean-up.

* js/mingw-tests-2.8:
Windows: shorten code by re-using convert_slashes()

Merge branch 'cc/apply'Junio C Hamano Wed, 13 Apr 2016 21:12:34 +0000 (14:12 -0700)

Merge branch 'cc/apply'

Minor code clean-up.

* cc/apply:
builtin/apply: free patch when parse_chunk() fails
builtin/apply: handle parse_binary() failure
apply: remove unused call to free() in gitdiff_{old,new}name()
builtin/apply: get rid of useless 'name' variable

Merge branch 'sb/misc-cleanups'Junio C Hamano Wed, 13 Apr 2016 21:12:34 +0000 (14:12 -0700)

Merge branch 'sb/misc-cleanups'

Assorted minor clean-ups.

* sb/misc-cleanups:
credential-cache, send_request: close fd when done
bundle: don't leak an fd in case of early return
abbrev_sha1_in_line: don't leak memory
notes: don't leak memory in git_config_get_notes_strategy

Merge branch 'sk/send-pack-all-fix'Junio C Hamano Wed, 13 Apr 2016 21:12:33 +0000 (14:12 -0700)

Merge branch 'sk/send-pack-all-fix'

"git send-pack --all <there>" was broken when its command line
option parsing was written in the 2.6 timeframe.

* sk/send-pack-all-fix:
git-send-pack: fix --all option when used with directory

Merge branch 'sg/diff-multiple-identical-renames'Junio C Hamano Wed, 13 Apr 2016 21:12:32 +0000 (14:12 -0700)

Merge branch 'sg/diff-multiple-identical-renames'

"git diff -M" used to work better when two originally identical
files A and B got renamed to X/A and X/B by pairing A to X/A and B
to X/B, but this was broken in the 2.0 timeframe.

* sg/diff-multiple-identical-renames:
diffcore: fix iteration order of identical files during rename detection

Merge branch 'kn/for-each-tag-branch'Junio C Hamano Wed, 13 Apr 2016 21:12:31 +0000 (14:12 -0700)

Merge branch 'kn/for-each-tag-branch'

A minor documentation update.

* kn/for-each-tag-branch:
for-each-ref: fix description of '--contains' in manpage

Merge branch 'ky/branch-d-worktree'Junio C Hamano Wed, 13 Apr 2016 21:12:30 +0000 (14:12 -0700)

Merge branch 'ky/branch-d-worktree'

When "git worktree" feature is in use, "git branch -d" allowed
deletion of a branch that is checked out in another worktree

* ky/branch-d-worktree:
branch -d: refuse deleting a branch which is currently checked out

Merge branch 'rz/worktree-no-checkout'Junio C Hamano Wed, 13 Apr 2016 21:12:30 +0000 (14:12 -0700)

Merge branch 'rz/worktree-no-checkout'

"git worktree add" can be given "--no-checkout" option to only
create an empty worktree without checking out the files.

* rz/worktree-no-checkout:
worktree: add: introduce --checkout option

Merge branch 'rt/rebase-i-shorten-stop-report'Junio C Hamano Wed, 13 Apr 2016 21:12:30 +0000 (14:12 -0700)

Merge branch 'rt/rebase-i-shorten-stop-report'

The commit object name reported when "rebase -i" stops has been
shortened.

* rt/rebase-i-shorten-stop-report:
rebase-i: print an abbreviated hash when stop for editing

Merge branch 'rt/completion-help'Junio C Hamano Wed, 13 Apr 2016 21:12:29 +0000 (14:12 -0700)

Merge branch 'rt/completion-help'

Shell completion (in contrib/) updates.

* rt/completion-help:
completion: add 'revisions' and 'everyday' to 'git help'
completion: add option '--guides' to 'git help'

Merge branch 'ak/use-hashmap-iter-first-in-submodule... Junio C Hamano Wed, 13 Apr 2016 21:12:29 +0000 (14:12 -0700)

Merge branch 'ak/use-hashmap-iter-first-in-submodule-config'

Minor code cleanup.

* ak/use-hashmap-iter-first-in-submodule-config:
submodule-config: use hashmap_iter_first()

Merge branch 'jk/check-repository-format'Junio C Hamano Wed, 13 Apr 2016 21:12:28 +0000 (14:12 -0700)

Merge branch 'jk/check-repository-format'

The repository set-up sequence has been streamlined (the biggest
change is that there is no longer git_config_early()), so that we
do not attempt to look into refs/* when we know we do not have a
Git repository.

* jk/check-repository-format:
verify_repository_format: mark messages for translation
setup: drop repository_format_version global
setup: unify repository version callbacks
init: use setup.c's repo version verification
setup: refactor repo format reading and verification
config: drop git_config_early
check_repository_format_gently: stop using git_config_early
lazily load core.sharedrepository
wrap shared_repository global in get/set accessors
setup: document check_repository_format()

Third batch for post 2.8 cycleJunio C Hamano Fri, 8 Apr 2016 21:34:11 +0000 (14:34 -0700)

Third batch for post 2.8 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ss/msvc'Junio C Hamano Fri, 8 Apr 2016 21:29:13 +0000 (14:29 -0700)

Merge branch 'ss/msvc'

Build updates for MSVC.

* ss/msvc:
MSVC: use shipped headers instead of fallback definitions
MSVC: vsnprintf in Visual Studio 2015 doesn't need SNPRINTF_SIZE_CORR any more

Merge branch 'oa/doc-diff-check'Junio C Hamano Fri, 8 Apr 2016 21:29:13 +0000 (14:29 -0700)

Merge branch 'oa/doc-diff-check'

A minor documentation update.

* oa/doc-diff-check:
Documentation: git diff --check detects conflict markers

Merge branch 'pb/opt-cmdmode-doc'Junio C Hamano Fri, 8 Apr 2016 21:29:12 +0000 (14:29 -0700)

Merge branch 'pb/opt-cmdmode-doc'

Minor API documentation update.

* pb/opt-cmdmode-doc:
api-parse-options.txt: document OPT_CMDMODE()

Merge branch 'nd/apply-report-skip'Junio C Hamano Fri, 8 Apr 2016 21:29:12 +0000 (14:29 -0700)

Merge branch 'nd/apply-report-skip'

"git apply -v" learned to report paths in the patch that were
skipped via --include/--exclude mechanism or being outside the
current working directory.

* nd/apply-report-skip:
apply: report patch skipping in verbose mode

Merge branch 'nd/apply-doc'Junio C Hamano Fri, 8 Apr 2016 21:29:12 +0000 (14:29 -0700)

Merge branch 'nd/apply-doc'

A minor documentation update.

* nd/apply-doc:
git-apply.txt: mention the behavior inside a subdir
git-apply.txt: remove a space

Merge branch 'jc/merge-refuse-new-root'Junio C Hamano Fri, 8 Apr 2016 21:29:11 +0000 (14:29 -0700)

Merge branch 'jc/merge-refuse-new-root'

"git merge" used to allow merging two branches that have no common
base by default, which led to a brand new history of an existing
project created and then get pulled by an unsuspecting maintainer,
which allowed an unnecessary parallel history merged into the
existing project. The command has been taught not to allow this by
default, with an escape hatch "--allow-unrelated-histories" option
to be used in a rare event that merges histories of two projects
that started their lives independently.

* jc/merge-refuse-new-root:
merge: refuse to create too cool a merge by default

Second batch for post 2.8 cycleJunio C Hamano Wed, 6 Apr 2016 18:44:24 +0000 (11:44 -0700)

Second batch for post 2.8 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'la/tag-force-signing-annotated-tags'Junio C Hamano Wed, 6 Apr 2016 18:39:13 +0000 (11:39 -0700)

Merge branch 'la/tag-force-signing-annotated-tags'

"git tag" can create an annotated tag without explicitly given an
"-a" (or "-s") option (i.e. when a tag message is given). A new
configuration variable, tag.forceSignAnnotated, can be used to tell
the command to create signed tag in such a situation.

* la/tag-force-signing-annotated-tags:
tag: add the option to force signing of annotated tags

Merge branch 'jk/submodule-c-credential'Junio C Hamano Wed, 6 Apr 2016 18:39:12 +0000 (11:39 -0700)

Merge branch 'jk/submodule-c-credential'

"git -c credential.<var>=<value> submodule" can now be used to
propagate configuration variables related to credential helper
down to the submodules.

* jk/submodule-c-credential:
git_config_push_parameter: handle empty GIT_CONFIG_PARAMETERS
git: submodule honor -c credential.* from command line
quote: implement sq_quotef()
submodule: fix segmentation fault in submodule--helper clone
submodule: fix submodule--helper clone usage
submodule: check argc count for git submodule--helper clone
submodule: don't pass empty string arguments to submodule--helper clone

Merge branch 'jv/merge-nothing-into-void'Junio C Hamano Wed, 6 Apr 2016 18:39:11 +0000 (11:39 -0700)

Merge branch 'jv/merge-nothing-into-void'

"git merge FETCH_HEAD" dereferenced NULL pointer when merging
nothing into an unborn history (which is arguably unusual usage,
which perhaps was the reason why nobody noticed it).

* jv/merge-nothing-into-void:
merge: fix NULL pointer dereference when merging nothing into void

Merge branch 'ss/commit-squash-msg'Junio C Hamano Wed, 6 Apr 2016 18:39:10 +0000 (11:39 -0700)

Merge branch 'ss/commit-squash-msg'

When "git merge --squash" stopped due to conflict, the concluding
"git commit" failed to read in the SQUASH_MSG that shows the log
messages from all the squashed commits.

* ss/commit-squash-msg:
commit: do not lose SQUASH_MSG contents

Merge branch 'sb/rebase-x'Junio C Hamano Wed, 6 Apr 2016 18:39:09 +0000 (11:39 -0700)

Merge branch 'sb/rebase-x'

"git rebase -x" can be used without passing "-i" option.

* sb/rebase-x:
t3404: cleanup double empty lines between tests
rebase: decouple --exec from --interactive

Merge branch 'jk/test-httpd-config-nosystem'Junio C Hamano Wed, 6 Apr 2016 18:39:08 +0000 (11:39 -0700)

Merge branch 'jk/test-httpd-config-nosystem'

The tests that involve running httpd leaked the system-wide
configuration in /etc/gitconfig to the tested environment.

* jk/test-httpd-config-nosystem:
t/lib-httpd: pass through GIT_CONFIG_NOSYSTEM env

Merge branch 'jk/send-email-rtrim-mailrc-alias'Junio C Hamano Wed, 6 Apr 2016 18:39:07 +0000 (11:39 -0700)

Merge branch 'jk/send-email-rtrim-mailrc-alias'

"git send-email" had trouble parsing alias file in mailrc format
when lines in it had trailing whitespaces on them.

* jk/send-email-rtrim-mailrc-alias:
send-email: ignore trailing whitespace in mailrc alias file

Merge branch 'jk/credential-cache-comment-exit'Junio C Hamano Wed, 6 Apr 2016 18:39:06 +0000 (11:39 -0700)

Merge branch 'jk/credential-cache-comment-exit'

A code clarification.

* jk/credential-cache-comment-exit:
credential-cache--daemon: clarify "exit" action semantics

Merge branch 'sb/clone-t57-t56'Junio C Hamano Wed, 6 Apr 2016 18:39:05 +0000 (11:39 -0700)

Merge branch 'sb/clone-t57-t56'

Rename bunch of tests on "git clone" for better organization.

* sb/clone-t57-t56:
clone tests: rename t57* => t56*

Merge branch 'ls/p4-map-user'Junio C Hamano Wed, 6 Apr 2016 18:39:05 +0000 (11:39 -0700)

Merge branch 'ls/p4-map-user'

"git p4" now allows P4 author names to be mapped to Git author
names.

* ls/p4-map-user:
git-p4: map a P4 user to Git author name and email address

Merge branch 'cc/doc-recommend-performance-trace-to... Junio C Hamano Wed, 6 Apr 2016 18:39:04 +0000 (11:39 -0700)

Merge branch 'cc/doc-recommend-performance-trace-to-file'

A minor documentation update.

* cc/doc-recommend-performance-trace-to-file:
Documentation: talk about pager in api-trace.txt

Merge branch 'pb/t7502-drop-dup'Junio C Hamano Wed, 6 Apr 2016 18:39:03 +0000 (11:39 -0700)

Merge branch 'pb/t7502-drop-dup'

Code clean-up.

* pb/t7502-drop-dup:
t/t7502 : drop duplicate test

Merge branch 'da/mergetool-delete-delete-conflict'Junio C Hamano Wed, 6 Apr 2016 18:39:02 +0000 (11:39 -0700)

Merge branch 'da/mergetool-delete-delete-conflict'

"git mergetool" did not work well with conflicts that both sides
deleted.

* da/mergetool-delete-delete-conflict:
mergetool: honor tempfile configuration when resolving delete conflicts
mergetool: support delete/delete conflicts

Merge branch 'sb/submodule-parallel-update'Junio C Hamano Wed, 6 Apr 2016 18:39:01 +0000 (11:39 -0700)

Merge branch 'sb/submodule-parallel-update'

A major part of "git submodule update" has been ported to C to take
advantage of the recently added framework to run download tasks in
parallel.

* sb/submodule-parallel-update:
clone: allow an explicit argument for parallel submodule clones
submodule update: expose parallelism to the user
submodule helper: remove double 'fatal: ' prefix
git submodule update: have a dedicated helper for cloning
run_processes_parallel: rename parameters for the callbacks
run_processes_parallel: treat output of children as byte array
submodule update: direct error message to stderr
fetching submodules: respect `submodule.fetchJobs` config option
submodule-config: drop check against NULL
submodule-config: keep update strategy around

Merge branch 'ss/receive-pack-parse-options'Junio C Hamano Wed, 6 Apr 2016 18:38:59 +0000 (11:38 -0700)

Merge branch 'ss/receive-pack-parse-options'

The command line argument parser for "receive-pack" has been
rewritten to use parse-options.

* ss/receive-pack-parse-options:
builtin/receive-pack.c: use parse_options API

Merge branch 'ss/exc-flag-is-a-collection-of-bits'Junio C Hamano Wed, 6 Apr 2016 18:38:59 +0000 (11:38 -0700)

Merge branch 'ss/exc-flag-is-a-collection-of-bits'

Code clean-up.

* ss/exc-flag-is-a-collection-of-bits:
dir: store EXC_FLAG_* values in unsigned integers

Windows: shorten code by re-using convert_slashes()Johannes Sixt Sat, 2 Apr 2016 19:03:14 +0000 (21:03 +0200)

Windows: shorten code by re-using convert_slashes()

Make a few more spots more readable by using the recently introduced,
Windows-specific helper.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-format-patch.txt: don't show -s as shorthand for... Eric Sunshine Sun, 27 Mar 2016 21:26:07 +0000 (17:26 -0400)

git-format-patch.txt: don't show -s as shorthand for multiple options

git-format-patch recognizes -s as shorthand only for --signoff, however,
its documentation shows -s as shorthand for both --signoff and
--no-patch. Resolve this confusion by suppressing the bogus -s shorthand
for --no-patch.

While here, also avoid showing the --no-patch option in git-format-patch
documentation since it doesn't make sense to ask to suppress the patch
while at the same time explicitly asking to format the patch (which,
after all, is the purpose of git-format-patch).

Reported-by: Kevin Brodsky <corax26@gmail.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

First batch for post 2.8 cycleJunio C Hamano Sun, 3 Apr 2016 17:55:36 +0000 (10:55 -0700)

First batch for post 2.8 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with Git 2.8.1Junio C Hamano Sun, 3 Apr 2016 17:54:38 +0000 (10:54 -0700)

Sync with Git 2.8.1

Merge branch 'jk/startup-info'Junio C Hamano Sun, 3 Apr 2016 17:29:35 +0000 (10:29 -0700)

Merge branch 'jk/startup-info'

The startup_info data, which records if we are working inside a
repository (among other things), are now uniformly available to Git
subcommand implementations, and Git avoids attempting to touch
references when we are not in a repository.

* jk/startup-info:
use setup_git_directory() in test-* programs
grep: turn off gitlink detection for --no-index
mailmap: do not resolve blobs in a non-repository
remote: don't resolve HEAD in non-repository
setup: set startup_info->have_repository more reliably
setup: make startup_info available everywhere

Merge branch 'es/test-gpg-tags'Junio C Hamano Sun, 3 Apr 2016 17:29:35 +0000 (10:29 -0700)

Merge branch 'es/test-gpg-tags'

A test for tags has been restructured so that more parts of it can
easily be run on a platform without a working GnuPG.

* es/test-gpg-tags:
t6302: skip only signed tags rather than all tests when GPG is missing
t6302: also test annotated in addition to signed tags
t6302: normalize names and descriptions of signed tags
lib-gpg: drop unnecessary "missing GPG" warning

Merge branch 'jk/getwholeline-getdelim-empty'Junio C Hamano Sun, 3 Apr 2016 17:29:34 +0000 (10:29 -0700)

Merge branch 'jk/getwholeline-getdelim-empty'

strbuf_getwholeline() did not NUL-terminate the buffer on certain
corner cases in its error codepath.

* jk/getwholeline-getdelim-empty:
strbuf_getwholeline: NUL-terminate getdelim buffer on error

Merge branch 'rj/xdiff-prepare-plug-leak-on-error-codepath'Junio C Hamano Sun, 3 Apr 2016 17:29:33 +0000 (10:29 -0700)

Merge branch 'rj/xdiff-prepare-plug-leak-on-error-codepath'

A small memory leak in an error codepath has been plugged in xdiff
code.

* rj/xdiff-prepare-plug-leak-on-error-codepath:
xdiff/xprepare: fix a memory leak
xdiff/xprepare: use the XDF_DIFF_ALG() macro to access flag bits

Merge branch 'jc/index-pack'Junio C Hamano Sun, 3 Apr 2016 17:29:31 +0000 (10:29 -0700)

Merge branch 'jc/index-pack'

Code clean-up.

* jc/index-pack:
index-pack: add a helper function to derive .idx/.keep filename

Merge branch 'gf/fetch-pack-direct-object-fetch'Junio C Hamano Sun, 3 Apr 2016 17:29:29 +0000 (10:29 -0700)

Merge branch 'gf/fetch-pack-direct-object-fetch'

Fetching of history by naming a commit object name directly didn't
work across remote-curl transport.

* gf/fetch-pack-direct-object-fetch:
fetch-pack: update the documentation for "<refs>..." arguments
fetch-pack: fix object_id of exact sha1

Merge branch 'jc/maint-index-pack-keep'Junio C Hamano Sun, 3 Apr 2016 17:29:29 +0000 (10:29 -0700)

Merge branch 'jc/maint-index-pack-keep'

"git index-pack --keep[=<msg>] pack-$name.pack" simply did not work.

* jc/maint-index-pack-keep:
index-pack: correct --keep[=<msg>]

Merge branch 'mm/lockfile-error-message'Junio C Hamano Sun, 3 Apr 2016 17:29:27 +0000 (10:29 -0700)

Merge branch 'mm/lockfile-error-message'

* mm/lockfile-error-message:
lockfile: improve error message when lockfile exists
lockfile: mark strings for translation

Merge branch 'jk/rev-parse-local-env-vars'Junio C Hamano Sun, 3 Apr 2016 17:29:26 +0000 (10:29 -0700)

Merge branch 'jk/rev-parse-local-env-vars'

The "--local-env-vars" and "--resolve-git-dir" options of "git
rev-parse" failed to work outside a repository when the command's
option parsing was rewritten in 1.8.5 era.

* jk/rev-parse-local-env-vars:
rev-parse: let some options run outside repository
t1515: add tests for rev-parse out-of-repo helpers

Merge branch 'jk/config-get-urlmatch'Junio C Hamano Sun, 3 Apr 2016 17:29:26 +0000 (10:29 -0700)

Merge branch 'jk/config-get-urlmatch'

"git config --get-urlmatch", unlike other variants of the "git
config --get" family, did not signal error with its exit status
when there was no matching configuration.

* jk/config-get-urlmatch:
Documentation/git-config: fix --get-all description
Documentation/git-config: use bulleted list for exit codes
config: fail if --get-urlmatch finds no value

Merge branch 'jk/add-i-highlight'Junio C Hamano Sun, 3 Apr 2016 17:29:25 +0000 (10:29 -0700)

Merge branch 'jk/add-i-highlight'

* jk/add-i-highlight:
add--interactive: allow custom diff highlighting programs

Merge branch 'jk/credential-clear-config'Junio C Hamano Sun, 3 Apr 2016 17:29:24 +0000 (10:29 -0700)

Merge branch 'jk/credential-clear-config'

The credential.helper configuration variable is cumulative and
there is no good way to override it from the command line. As
a special case, giving an empty string as its value now serves
as the signal to clear the values specified in various files.

* jk/credential-clear-config:
credential: let empty credential specs reset helper list

Merge branch 'mp/upload-pack-use-embedded-args'Junio C Hamano Sun, 3 Apr 2016 17:29:23 +0000 (10:29 -0700)

Merge branch 'mp/upload-pack-use-embedded-args'

The embedded args argv-array in the child process is used to build
the command line to run pack-objects instead of using a separate
array of strings.

* mp/upload-pack-use-embedded-args:
upload-pack: use argv_array for pack_objects

Merge branch 'mm/diff-renames-default'Junio C Hamano Sun, 3 Apr 2016 17:29:22 +0000 (10:29 -0700)

Merge branch 'mm/diff-renames-default'

The end-user facing Porcelain level commands like "diff" and "log"
now enables the rename detection by default.

* mm/diff-renames-default:
diff: activate diff.renames by default
log: introduce init_log_defaults()
t: add tests for diff.renames (true/false/unset)
t4001-diff-rename: wrap file creations in a test
Documentation/diff-config: fix description of diff.renames

Merge branch 'mm/readme-markdown'Junio C Hamano Sun, 3 Apr 2016 17:27:22 +0000 (10:27 -0700)

Merge branch 'mm/readme-markdown'

Fix a few broken links in README.md and also teach rpmbuild
that there is no README.

* mm/readme-markdown:
README.md: don't take 'commandname' literally
git.spec.in: use README.md, not README

Git 2.8.1 v2.8.1Junio C Hamano Sun, 3 Apr 2016 17:11:35 +0000 (10:11 -0700)

Git 2.8.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'mm/readme-markdown' into maintJunio C Hamano Sun, 3 Apr 2016 17:13:09 +0000 (10:13 -0700)

Merge branch 'mm/readme-markdown' into maint

* 'mm/readme-markdown':
git.spec.in: use README.md, not README

README.md: don't take 'commandname' literallyMatthieu Moy Sat, 27 Feb 2016 10:46:12 +0000 (11:46 +0100)

README.md: don't take 'commandname' literally

The link to Documentation/git-commandname.txt was obviously broken.
Remove the link and make it clear that it is not a literal path name by
using *italics* in makdown.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git.spec.in: use README.md, not READMEMatthieu Moy Fri, 1 Apr 2016 07:10:51 +0000 (09:10 +0200)

git.spec.in: use README.md, not README

The file was renamed in 4ad21f5 (README: use markdown syntax,
2016-02-25), but that commit forgot to update git.spec.in, which
caused the rpmbuild target in the Makefile to fail.

Reported-by: Ron Isaacson <isaacson.ljits@gmail.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

credential-cache, send_request: close fd when doneStefan Beller Fri, 1 Apr 2016 00:35:46 +0000 (17:35 -0700)

credential-cache, send_request: close fd when done

No need to keep it open any further.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bundle: don't leak an fd in case of early returnStefan Beller Fri, 1 Apr 2016 00:35:45 +0000 (17:35 -0700)

bundle: don't leak an fd in case of early return

In successful operation `write_pack_data` will close the `bundle_fd`,
but when we exit early, we need to take care of the file descriptor
as well as the lock file ourselves. The lock file may be deleted at the
end of running the program, but we are in library code, so we should
not rely on that.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

abbrev_sha1_in_line: don't leak memoryStefan Beller Fri, 1 Apr 2016 00:35:44 +0000 (17:35 -0700)

abbrev_sha1_in_line: don't leak memory

`split` is of type `struct strbuf **`, and currently we are leaking split
itself as well as each element in split[i]. We have a dedicated free
function for `struct strbuf **`, which takes care of freeing all
related memory.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

notes: don't leak memory in git_config_get_notes_strategyStefan Beller Fri, 1 Apr 2016 00:35:43 +0000 (17:35 -0700)

notes: don't leak memory in git_config_get_notes_strategy

This function asks for the value of a configuration and after
using the value does not have to retain ownership of it.
git_config_get_string_const() however is a function to get a
copy of the value, but we forget to free it before we return.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/apply: free patch when parse_chunk() failsChristian Couder Wed, 16 Mar 2016 19:35:11 +0000 (20:35 +0100)

builtin/apply: free patch when parse_chunk() fails

When parse_chunk() fails it can return -1, for example
when find_header() doesn't find a patch header.

In this case it's better in apply_patch() to free the
"struct patch" that we just allocated instead of
leaking it.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/apply: handle parse_binary() failureChristian Couder Fri, 18 Mar 2016 12:30:41 +0000 (13:30 +0100)

builtin/apply: handle parse_binary() failure

In parse_binary() there is:

forward = parse_binary_hunk(&buffer, &size, &status, &used);
if (!forward && !status)
/* there has to be one hunk (forward hunk) */
return error(_("unrecognized binary patch at line %d"), linenr-1);

so parse_binary() can return -1, because that's what error() returns.

Also parse_binary_hunk() sets "status" to -1 in case of error and
parse_binary() does "if (status) return status;".

In this case parse_chunk() should not add -1 to the patchsize it computes.
It is better for future libification efforts to make it just return -1.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-send-pack: fix --all option when used with directoryStanislav Kolotinskiy Thu, 31 Mar 2016 13:55:09 +0000 (16:55 +0300)

git-send-pack: fix --all option when used with directory

When using git send-pack with --all option
and a target repository specification ([<host>:]<directory>),
usage message is being displayed instead of performing
the actual transmission.

The reason for this issue is that destination and refspecs are being set
in the same conditional and are populated from argv. When a target
repository is passed, refspecs is being populated as well with its value.
This makes the check for refspecs not being NULL to always return true,
which, in conjunction with the check for --all or --mirror options,
is always true as well and returns usage message instead of proceeding.

This ensures that send-pack will stop execution only when --all
or --mirror switch is used in conjunction with any refspecs passed.

Signed-off-by: Stanislav Kolotinskiy <stanislav@assembla.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

for-each-ref: fix description of '--contains' in manpageSZEDER Gábor Wed, 30 Mar 2016 13:48:30 +0000 (15:48 +0200)

for-each-ref: fix description of '--contains' in manpage

'git for-each-ref's manpage says that '--contains' only lists tags,
but it lists all kinds of refs.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diffcore: fix iteration order of identical files during... SZEDER Gábor Wed, 30 Mar 2016 08:35:07 +0000 (10:35 +0200)

diffcore: fix iteration order of identical files during rename detection

If the two paths 'dir/A/file' and 'dir/B/file' have identical content
and the parent directory is renamed, e.g. 'git mv dir other-dir', then
diffcore reports the following exact renames:

renamed: dir/B/file -> other-dir/A/file
renamed: dir/A/file -> other-dir/B/file

While technically not wrong, this is confusing not only for the user,
but also for git commands that make decisions based on rename
information, e.g. 'git log --follow other-dir/A/file' follows
'dir/B/file' past the rename.

This behavior is a side effect of commit v2.0.0-rc4~8^2~14
(diffcore-rename.c: simplify finding exact renames, 2013-11-14): the
hashmap storing sources returns entries from the same bucket, i.e.
sources matching the current destination, in LIFO order. Thus the
iteration first examines 'other-dir/A/file' and 'dir/B/file' and, upon
finding identical content and basename, reports an exact rename.

Other hashmap users are apparently happy with the current iteration
order over the entries of a bucket. Changing the iteration order
would risk upsetting other hashmap users and would increase the memory
footprint of each bucket by a pointer to the tail element.

Fill the hashmap with source entries in reverse order to restore the
original exact rename detection behavior.

Reported-by: Bill Okara <billokara@gmail.com>
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

MSVC: use shipped headers instead of fallback definitionsSven Strickroth Wed, 30 Mar 2016 11:37:36 +0000 (13:37 +0200)

MSVC: use shipped headers instead of fallback definitions

VS2010 comes with stdint.h [1]
VS2013 comes with inttypes.h [2]

[1] https://stackoverflow.com/a/2628014/3906760
[2] https://blogs.msdn.microsoft.com/vcblog/2013/07/19/c99-library-support-in-visual-studio-2013/

Signed-off-by: Sven Strickroth <sven@cs-ware.de>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Acked-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

MSVC: vsnprintf in Visual Studio 2015 doesn't need... Sven Strickroth Tue, 29 Mar 2016 16:25:28 +0000 (18:25 +0200)

MSVC: vsnprintf in Visual Studio 2015 doesn't need SNPRINTF_SIZE_CORR any more

In MSVC2015 the behavior of vsnprintf was changed.
W/o this fix there is one character missing at the end.

Signed-off-by: Sven Strickroth <sven@cs-ware.de>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Acked-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: git diff --check detects conflict markersOri Avtalion Tue, 29 Mar 2016 18:59:45 +0000 (21:59 +0300)

Documentation: git diff --check detects conflict markers

Signed-off-by: Ori Avtalion <ori@avtalion.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

branch -d: refuse deleting a branch which is currently... Kazuki Yamaguchi Tue, 29 Mar 2016 09:38:39 +0000 (18:38 +0900)

branch -d: refuse deleting a branch which is currently checked out

When a branch is checked out by current working tree, deleting the
branch is forbidden. However when the branch is checked out only by
other working trees, deleting incorrectly succeeds.
Use find_shared_symref() to check if the branch is in use, not just
comparing with the current working tree's HEAD.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

worktree: add: introduce --checkout optionRay Zhang Tue, 29 Mar 2016 10:11:01 +0000 (10:11 +0000)

worktree: add: introduce --checkout option

By adding this option which defaults to true, we can use the
corresponding --no-checkout to make some customizations before
the checkout, like sparse checkout, etc.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Ray Zhang <zhanglei002@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.8 v2.8.0Junio C Hamano Mon, 28 Mar 2016 19:19:45 +0000 (12:19 -0700)

Git 2.8

Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase-i: print an abbreviated hash when stop for editingRalf Thielow Mon, 28 Mar 2016 16:00:00 +0000 (18:00 +0200)

rebase-i: print an abbreviated hash when stop for editing

The message that is shown when rebase-i stops for editing prints
the full hash of the commit where it stopped which makes the message
overflow to the next line on smaller terminal windows. Print an
abbreviated hash instead.

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

api-parse-options.txt: document OPT_CMDMODE()Pranit Bauva Fri, 25 Mar 2016 18:58:58 +0000 (18:58 +0000)

api-parse-options.txt: document OPT_CMDMODE()

OPT_CMDMODE mechanism was introduced in the release of 1.8.5 to actively
notice when multiple "operation mode" options that specify mutually
incompatible operation modes are given.

Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: add 'revisions' and 'everyday' to 'git... Ralf Thielow Thu, 24 Mar 2016 18:27:14 +0000 (19:27 +0100)

completion: add 'revisions' and 'everyday' to 'git help'

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: add option '--guides' to 'git help'Ralf Thielow Thu, 24 Mar 2016 18:27:13 +0000 (19:27 +0100)

completion: add option '--guides' to 'git help'

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ls/p4-doc-markup'Junio C Hamano Thu, 24 Mar 2016 19:28:06 +0000 (12:28 -0700)

Merge branch 'ls/p4-doc-markup'

* ls/p4-doc-markup:
Documentation: fix git-p4 AsciiDoc formatting
Documentation: use ASCII quotation marks in git-p4

Merge branch 'js/mingw-tests-2.8'Junio C Hamano Thu, 24 Mar 2016 19:27:58 +0000 (12:27 -0700)

Merge branch 'js/mingw-tests-2.8'

* js/mingw-tests-2.8:
mingw: skip some tests in t9115 due to file name issues
t1300: fix the new --show-origin tests on Windows
t1300-repo-config: make it resilient to being run via 'sh -x'
config --show-origin: report paths with forward slashes

Merge branch 'sb/submodule-module-list-pathspec-fix'Junio C Hamano Thu, 24 Mar 2016 19:27:12 +0000 (12:27 -0700)

Merge branch 'sb/submodule-module-list-pathspec-fix'

A fix for a small regression in "module_list" helper that was
rewritten in C (also applies to 2.7.x).

* sb/submodule-module-list-pathspec-fix:
submodule: fix regression for deinit without submodules

apply: report patch skipping in verbose modeNguyễn Thái Ngọc Duy Thu, 24 Mar 2016 11:56:19 +0000 (18:56 +0700)

apply: report patch skipping in verbose mode

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-apply.txt: mention the behavior inside a subdirNguyễn Thái Ngọc Duy Thu, 24 Mar 2016 11:56:17 +0000 (18:56 +0700)

git-apply.txt: mention the behavior inside a subdir

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-apply.txt: remove a spaceNguyễn Thái Ngọc Duy Thu, 24 Mar 2016 11:56:16 +0000 (18:56 +0700)

git-apply.txt: remove a space

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule-config: use hashmap_iter_first()Alexander Kuleshov Wed, 16 Mar 2016 07:46:31 +0000 (13:46 +0600)

submodule-config: use hashmap_iter_first()

The hashmap API provides hashmap_iter_first() helper for initialion
and getting the first entry of a hashmap. Let's use it instead of
doing initialization manually and then get the first entry.

There are no functional changes, just cleanup.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'master' of git://github.com/git-l10n... Junio C Hamano Wed, 23 Mar 2016 19:22:42 +0000 (12:22 -0700)

Merge branch 'master' of git://github.com/git-l10n/git-po

* 'master' of git://github.com/git-l10n/git-po:
l10n: pt_PT: Update and add new translations
l10n: ca.po: update translation
l10n: vi.po (2530t): Update translation

merge: refuse to create too cool a merge by defaultJunio C Hamano Fri, 18 Mar 2016 20:21:09 +0000 (13:21 -0700)

merge: refuse to create too cool a merge by default

While it makes sense to allow merging unrelated histories of two
projects that started independently into one, in the way "gitk" was
merged to "git" itself aka "the coolest merge ever", such a merge is
still an unusual event. Worse, if somebody creates an independent
history by starting from a tarball of an established project and
sends a pull request to the original project, "git merge" however
happily creates such a merge without any sign of something unusual
is happening.

Teach "git merge" to refuse to create such a merge by default,
unless the user passes a new "--allow-unrelated-histories" option to
tell it that the user is aware that two unrelated projects are
merged.

Because such a "two project merge" is a rare event, a configuration
option to always allow such a merge is not added.

We could add the same option to "git pull" and have it passed
through to underlying "git merge". I do not have a fundamental
opposition against such a feature, but this commit does not do so
and instead leaves it as low-hanging fruit for others, because such
a "two project merge" would be done after fetching the other project
into some location in the working tree of an existing project and
making sure how well they fit together, it is sufficient to allow a
local merge without such an option pass-through from "git pull" to
"git merge". Many tests that are updated by this patch does the
pass-through manually by turning:

git pull something

into its equivalent:

git fetch something &&
git merge --allow-unrelated-histories FETCH_HEAD

If somebody is inclined to add such an option, updated tests in this
change need to be adjusted back to:

git pull --allow-unrelated-histories something

Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge: fix NULL pointer dereference when merging nothin... Junio C Hamano Mon, 21 Mar 2016 19:01:43 +0000 (12:01 -0700)

merge: fix NULL pointer dereference when merging nothing into void

When we are on an unborn branch and merging only one foreign parent,
we allow "git merge" to fast-forward to that foreign parent commit.

This codepath incorrectly attempted to dereference the list of
parents that the merge is going to record even when the list is
empty. It must refuse to operate instead when there is no parent.

All other codepaths make sure the list is not empty before they
dereference it, and are safe.

Reported-by: Jose Ivan B. Vilarouca Filho
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: fix git-p4 AsciiDoc formattingLars Schneider Wed, 23 Mar 2016 10:59:01 +0000 (11:59 +0100)

Documentation: fix git-p4 AsciiDoc formatting

Noticed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git_config_push_parameter: handle empty GIT_CONFIG_PARA... Jeff King Tue, 22 Mar 2016 19:50:51 +0000 (15:50 -0400)

git_config_push_parameter: handle empty GIT_CONFIG_PARAMETERS

The "git -c var=value" option stuffs the config value into
$GIT_CONFIG_PARAMETERS, so that sub-processes can see it.
When the config is later read via git_config() or similar,
we parse it back out of that variable. The parsing end is a
little bit picky; it assumes that each entry was generated
with sq_quote_buf(), and that there is no extraneous
whitespace.

On the generating end, we are careful to append to an
existing $GIT_CONFIG_PARAMETERS variable if it exists.
However, our test for "should we add a space separator" is
too liberal: it will add one even if the environment
variable exists but is empty. As a result, you might end up
with:

GIT_CONFIG_PARAMETERS=" 'core.foo=bar'"

which the parser will choke on.

This was hard to trigger in older versions of git, since we
only set the variable when we had something to put into it
(though you could certainly trigger it manually). But since
14111fc (git: submodule honor -c credential.* from command
line, 2016-02-29), the submodule code will unconditionally
put the $GIT_CONFIG_PARAMETERS variable into the environment
of any operation in the submodule, whether it is empty or
not. So any of those operations which themselves use "git
-c" will generate the unparseable value and fail.

We can easily fix it by catching this case on the generating
side. While we're adding a test, let's also check that
multiple layers of "git -c" work, which was previously not
tested at all.

Reported-by: Shin Fan <shinfan@google.com>
Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Tested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: skip some tests in t9115 due to file name issuesJohannes Schindelin Wed, 23 Mar 2016 10:55:20 +0000 (11:55 +0100)

mingw: skip some tests in t9115 due to file name issues

These two tests wanted to write file names which are incompatible with
Windows' file naming rules (even if they pass using Cygwin due to
Cygwin's magic path mangling).

While at it, skip the same tests also on MacOSX/HFS, as pointed out by
Torsten Bögershausen.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1300: fix the new --show-origin tests on WindowsJohannes Schindelin Wed, 23 Mar 2016 10:55:13 +0000 (11:55 +0100)

t1300: fix the new --show-origin tests on Windows

On Windows, we have that funny situation where the test script can refer
to POSIX paths because it runs in a shell that uses a POSIX emulation
layer ("MSYS2 runtime"). Yet, git.exe does *not* understand POSIX paths
at all but only pure Windows paths.

So let's just convert the POSIX paths to Windows paths before passing
them on to Git, using `pwd` (which is already modified on Windows to
output Windows paths).

While fixing the new tests on Windows, we also have to exclude the tests
that want to write a file with a name that is illegal on Windows
(unfortunately, there is more than one test trying to make use of that
file).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1300-repo-config: make it resilient to being run via... Johannes Schindelin Wed, 23 Mar 2016 10:55:07 +0000 (11:55 +0100)

t1300-repo-config: make it resilient to being run via 'sh -x'

One way to diagnose broken regression tests is to run the test
script using 'sh -x t... -i -v' to find out which call actually
demonstrates the symptom.

Hence it is pretty counterproductive if the test script behaves
differently when being run via 'sh -x', in particular when using
test_cmp or test_i18ncmp on redirected stderr. A more recent way
"sh tXXXX -i -v -x" has the same issue.

So let's use test_i18ngrep (as suggested by Jonathan Nieder) instead of
test_cmp/test_i18ncmp to verify that stderr looks as expected.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config --show-origin: report paths with forward slashesJohannes Schindelin Wed, 23 Mar 2016 10:55:00 +0000 (11:55 +0100)

config --show-origin: report paths with forward slashes

On Windows, the backslash is the native directory separator, but all
supported Windows versions also accept the forward slash in most
circumstances.

Our tests expect forward slashes.

Relative paths are generated by Git using forward slashes.

So let's try to be consistent and use forward slashes in the $HOME part
of the paths reported by `git config --show-origin`, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'master' of https://github.com/vnwildman/gitJiang Xin Wed, 23 Mar 2016 15:01:51 +0000 (23:01 +0800)

Merge branch 'master' of https://github.com/vnwildman/git

* 'master' of https://github.com/vnwildman/git:
l10n: vi.po (2530t): Update translation

Merge branch 'master' of git://github.com/alexhenrie... Jiang Xin Wed, 23 Mar 2016 14:48:14 +0000 (22:48 +0800)

Merge branch 'master' of git://github.com/alexhenrie/git-po

* 'master' of git://github.com/alexhenrie/git-po:
l10n: ca.po: update translation

submodule: fix regression for deinit without submodulesStefan Beller Tue, 22 Mar 2016 23:42:14 +0000 (16:42 -0700)

submodule: fix regression for deinit without submodules

Per Cederqvist wrote:
> It used to be possible to run
>
> git submodule deinit -f .
>
> to remove any submodules, no matter how many submodules you had. That
> is no longer possible in projects that don't have any submodules at
> all. The command will fail with:
>
> error: pathspec '.' did not match any file(s) known to git.

This regression was introduced in 74703a1e4dfc (submodule: rewrite
`module_list` shell function in C, 2015-09-02), as we changed the
order of checking in new module listing to first check whether it is
a gitlin before feeding it to match_pathspec(). It used to be that
a pathspec that does not match any path were diagnosed as an error,
but the new code complains for a pathspec that does not match any
submodule path.

Arguably the new behaviour may give us a better diagnosis, but that
is inconsistent with the suggestion "deinit" gives, and also this
was an unintended accident. The new behaviour hopefully can be
redesigned and implemented better in future releases, but for now,
switch these two checks to restore the same behavior as before. In
an empty repository, giving the pathspec '.' will still get the same
"did not match" error, but that is the same bug we had before 1.7.0.

Reported-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tag: add the option to force signing of annotated tagsLaurent Arnoud Tue, 22 Mar 2016 20:41:26 +0000 (21:41 +0100)

tag: add the option to force signing of annotated tags

The `tag.forcesignannotated` configuration variable makes "git tag"
that would implicitly create an annotated tag to instead create a
signed tag. For example

$ git tag -m "This is a message" tag-with-message
$ git tag -F message-file tag-with-message

would create a signed tag if the configuration variable is in
effect. To override this from the command line, the user can
explicitly ask for an annotated tag, like so:

$ git tag -a -m "This is a message" tag-with-message
$ git tag -a -F message-file tag-with-message

Creation of a light-weight tag, i.e.

$ git tag lightweight

is not affected.

Signed-off-by: Laurent Arnoud <laurent@spkdev.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

apply: remove unused call to free() in gitdiff_{old... Junio C Hamano Tue, 22 Mar 2016 21:41:08 +0000 (14:41 -0700)

apply: remove unused call to free() in gitdiff_{old,new}name()

These two functions keep a copy of filename it was given, let
gitdiff_verify_name() to rewrite it to a new filename and then free
the original if they receive a newly minted filename.

However

(1) when the original name is NULL, gitdiff_verify_name() returns
either NULL or a newly minted value. Either case, we do not
have to worry about calling free() on the original NULL.

(2) when the original name is not NULL, gitdiff_verify_name()
either returns that as-is, or calls die() when it finds
inconsistency in the patch. When the function returns, we know
that "if ()" statement always is false.

Noticed by Christian Couder.

Signed-off-by: Junio C Hamano <gitster@pobox.com>