gitweb.git
Sync with v2.12.3Junio C Hamano Tue, 9 May 2017 03:20:21 +0000 (20:20 -0700)

Sync with v2.12.3

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

Merge branch 'jh/verify-index-checksum-only-in-fsck'Junio C Hamano Tue, 9 May 2017 03:17:42 +0000 (12:17 +0900)

Merge branch 'jh/verify-index-checksum-only-in-fsck'

* jh/verify-index-checksum-only-in-fsck:
t1450: avoid use of "sed" on the index, which is a binary file

docs: correct receive.advertisePushOptions defaultJonathan Tan Mon, 8 May 2017 21:33:50 +0000 (14:33 -0700)

docs: correct receive.advertisePushOptions default

In commit c714e45 ("receive-pack: implement advertising and receiving
push options", 2016-07-14), receive-pack was taught to (among other
things) advertise that it understood push options, depending on
configuration. It was documented that it advertised such ability by
default; however, it actually does not. (In that commit, notice that
advertise_push_options defaults to 0, unlike advertise_atomic_push which
defaults to 1.)

Update the documentation to state that it does not advertise the ability
by default.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5310: fix "; do" styleJeff King Tue, 9 May 2017 02:59:46 +0000 (22:59 -0400)

t5310: fix "; do" style

Our usual shell style is to put the "do" of a loop on its
own line, like:

while $cond
do
something
done

instead of:

while $cond; do
something
done

We have a bit of both in our code base, but the former is
what's in CodingGuidelines (and outnumbers the latter in t/
by about 6:1).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects: disable pack reuse for object-selection... Jeff King Tue, 9 May 2017 02:54:13 +0000 (22:54 -0400)

pack-objects: disable pack reuse for object-selection options

If certain options like --honor-pack-keep, --local, or
--incremental are used with pack-objects, then we need to
feed each potential object to want_object_in_pack() to see
if it should be filtered out. But when the bitmap
reuse_packfile optimization is in effect, we do not call
that function at all, and in fact skip adding the objects to
the to_pack list entirely. This means we have a bug: for
certain requests we will silently ignore those options and
include objects in that pack that should not be there.

The problem has been present since the inception of the
pack-reuse code in 6b8fda2db (pack-objects: use bitmaps when
packing objects, 2013-12-21), but it was unlikely to come up
in practice. These options are generally used for on-disk
packing, not transfer packs (which go to stdout), but we've
never allowed pack reuse for non-stdout packs (until
645c432d6, we did not even use bitmaps, which the reuse
optimization relies on; after that, we explicitly turned it
off when not packing to stdout).

We can fix this by just disabling the reuse_packfile
optimization when the options are in use. In theory we could
teach the pack-reuse code to satisfy these checks, but it's
not worth the complexity. The purpose of the optimization is
to keep the amount of per-object work we do to a minimum.
But these options inherently require us to search for other
copies of each object, drowning out any benefit of the
pack-reuse optimization. But note that the optimizations
from 56dfeb626 (pack-objects: compute local/ignore_pack_keep
early, 2016-07-29) happen before pack-reuse, meaning that
specifying "--honor-pack-keep" in a repository with no .keep
files can still follow the fast path.

There are tests in t5310 that check these options with
bitmaps and --stdout, but they didn't catch the bug, and
it's hard to adapt them to do so.

One problem is that they don't use --delta-base-offset;
without that option, we always disable the reuse
optimization entirely. It would be fine to add it in (it
actually makes the test more realistic), but that still
isn't quite enough.

The other problem is that the reuse code is very picky; it
only kicks in when it can reuse most of a pack, starting
from the first byte. So we'd have to start from a fully
repacked and bitmapped state to trigger it. But the tests
for these options use a much more subtle state; they want to
be sure that the want_object_in_pack() code is allowing some
objects but not others. Doing a full repack runs counter to
that.

So this patch adds new tests at the end of the script which
create the fully-packed state and make sure that each option
is not fooled by reusable pack.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

apply.c: fix whitespace-only mismergeJunio C Hamano Tue, 9 May 2017 02:30:24 +0000 (19:30 -0700)

apply.c: fix whitespace-only mismerge

4af9a7d3 ("Merge branch 'bc/object-id'", 2016-09-19) involved
merging a lot of changes made to builtin/apply.c on the side branch
manually to apply.c as an intervening commit 13b5af22 ("apply: move
libified code from builtin/apply.c to apply.{c,h}", 2016-04-22)
moved a lot of the lines changed on the side branch to a different
file apply.c at the top-level, requiring manual patching of it.
Apparently, the maintainer screwed up and made the code indent in a
funny way while doing so.

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

archive-tar: fix a sparse 'constant too large' warningRamsay Jones Mon, 8 May 2017 20:34:58 +0000 (21:34 +0100)

archive-tar: fix a sparse 'constant too large' warning

Commit dddbad728c ("timestamp_t: a new data type for timestamps",
26-04-2017) introduced a new typedef 'timestamp_t', as a synonym for an
unsigned long, which was used at the time to represent timestamps in
git. A later commit 28f4aee3fb ("use uintmax_t for timestamps",
26-04-2017) changed the typedef to use an 'uintmax_t' for the timestamp
representation type.

When building on a 32-bit Linux system, sparse complains that a constant
(USTAR_MAX_MTIME) used to detect a 'far-future mtime' timestamp, is too
large; 'warning: constant 077777777777UL is so big it is unsigned long
long' on lines 335 and 338 of archive-tar.c. Note that both gcc and
clang only issue a warning if this constant is used in a context that
requires an 'unsigned long' (rather than an uintmax_t). (Since TIME_MAX
is no longer equal to 0xFFFFFFFF, even on a 32-bit system, the macro
USTAR_MAX_MTIME is set to 077777777777UL, which cannot be represented as
an 'unsigned long' constant).

In order to suppress the warning, change the definition of the macro
constant USTAR_MAX_MTIME to use an 'ULL' type suffix.

In a similar vein, on systems which use a 64-bit representation of the
'unsigned long' type, the USTAR_MAX_SIZE constant macro is defined with
the value 077777777777ULL. Although this does not cause any warning
messages to be issued, it would be more appropriate for this constant
to use an 'UL' type suffix rather than 'ULL'.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: zh_CN: review for git v2.13.0 l10n round 1Ray Chen Tue, 2 May 2017 15:42:43 +0000 (23:42 +0800)

l10n: zh_CN: review for git v2.13.0 l10n round 1

Signed-off-by: Ray Chen <oldsharp@gmail.com>

Merge branch 'master' of https://github.com/vnwildman/gitJiang Xin Mon, 8 May 2017 22:39:31 +0000 (06:39 +0800)

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

* 'master' of https://github.com/vnwildman/git:
l10n: vi.po(3195t): Update translation for v2.13.0 round 2

l10n: Update Catalan translationJordi Mas Sun, 7 May 2017 08:12:01 +0000 (10:12 +0200)

l10n: Update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>

l10n: bg.po: Updated Bulgarian translation (3195t)Alexander Shopov Sun, 7 May 2017 07:25:19 +0000 (09:25 +0200)

l10n: bg.po: Updated Bulgarian translation (3195t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>

Merge branch 'fr_l10n_v2.13_rnd2' of git://github.com... Jiang Xin Mon, 8 May 2017 22:18:53 +0000 (06:18 +0800)

Merge branch 'fr_l10n_v2.13_rnd2' of git://github.com/jnavila/git

* 'fr_l10n_v2.13_rnd2' of git://github.com/jnavila/git:
l10n: fr.po v2.13 rnd 2

object: convert parse_object* to take struct object_idbrian m. carlson Sat, 6 May 2017 22:10:38 +0000 (22:10 +0000)

object: convert parse_object* to take struct object_id

Make parse_object, parse_object_or_die, and parse_object_buffer take a
pointer to struct object_id. Remove the temporary variables inserted
earlier, since they are no longer necessary. Transform all of the
callers using the following semantic patch:

@@
expression E1;
@@
- parse_object(E1.hash)
+ parse_object(&E1)

@@
expression E1;
@@
- parse_object(E1->hash)
+ parse_object(E1)

@@
expression E1, E2;
@@
- parse_object_or_die(E1.hash, E2)
+ parse_object_or_die(&E1, E2)

@@
expression E1, E2;
@@
- parse_object_or_die(E1->hash, E2)
+ parse_object_or_die(E1, E2)

@@
expression E1, E2, E3, E4, E5;
@@
- parse_object_buffer(E1.hash, E2, E3, E4, E5)
+ parse_object_buffer(&E1, E2, E3, E4, E5)

@@
expression E1, E2, E3, E4, E5;
@@
- parse_object_buffer(E1->hash, E2, E3, E4, E5)
+ parse_object_buffer(E1, E2, E3, E4, E5)

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tree: convert parse_tree_indirect to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:37 +0000 (22:10 +0000)

tree: convert parse_tree_indirect to struct object_id

Convert parse_tree_indirect to take a pointer to struct object_id.
Update all the callers. This transformation was achieved using the
following semantic patch and manual updates to the declaration and
definition. Update builtin/checkout.c manually as well, since it uses a
ternary expression not handled by the semantic patch.

@@
expression E1;
@@
- parse_tree_indirect(E1.hash)
+ parse_tree_indirect(&E1)

@@
expression E1;
@@
- parse_tree_indirect(E1->hash)
+ parse_tree_indirect(E1)

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer: convert do_recursive_merge to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:36 +0000 (22:10 +0000)

sequencer: convert do_recursive_merge to struct object_id

This conversion is required to convert parse_tree_indirect.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-lib: convert do_diff_cache to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:35 +0000 (22:10 +0000)

diff-lib: convert do_diff_cache to struct object_id

This is needed to convert parse_tree_indirect.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/ls-tree: convert to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:34 +0000 (22:10 +0000)

builtin/ls-tree: convert to struct object_id

This is a prerequisite to convert do_diff_cache, which is required to
convert parse_tree_indirect.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge: convert checkout_fast_forward to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:33 +0000 (22:10 +0000)

merge: convert checkout_fast_forward to struct object_id

Converting checkout_fast_forward is required to convert
parse_tree_indirect.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer: convert fast_forward_to to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:32 +0000 (22:10 +0000)

sequencer: convert fast_forward_to to struct object_id

fast_forward_to is required for checkout_fast_fowrard, which is required
for parse_tree_indirect.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/ls-files: convert overlay_tree_on_cache to... brian m. carlson Sat, 6 May 2017 22:10:31 +0000 (22:10 +0000)

builtin/ls-files: convert overlay_tree_on_cache to object_id

This is another caller of parse_tree_indirect.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/read-tree: convert to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:30 +0000 (22:10 +0000)

builtin/read-tree: convert to struct object_id

This is a caller of parse_tree_indirect, which must be converted in
order to convert parse_object.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sha1_name: convert internals of peel_onion to object_idbrian m. carlson Sat, 6 May 2017 22:10:29 +0000 (22:10 +0000)

sha1_name: convert internals of peel_onion to object_id

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

upload-pack: convert remaining parse_object callers... brian m. carlson Sat, 6 May 2017 22:10:28 +0000 (22:10 +0000)

upload-pack: convert remaining parse_object callers to object_id

Convert the remaining parse_object callers to struct object_id. Use
named constants for several hard-coded values. In addition, rename
got_sha1 to got_oid to reflect the new argument.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

revision: convert remaining parse_object callers to... brian m. carlson Sat, 6 May 2017 22:10:27 +0000 (22:10 +0000)

revision: convert remaining parse_object callers to object_id

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

revision: rename add_pending_sha1 to add_pending_oidbrian m. carlson Sat, 6 May 2017 22:10:26 +0000 (22:10 +0000)

revision: rename add_pending_sha1 to add_pending_oid

Rename this function and convert it to take a pointer to struct
object_id.

This is a prerequisite for converting get_reference, which is needed to
convert parse_object.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-push: convert process_ls_object and descendants... brian m. carlson Sat, 6 May 2017 22:10:25 +0000 (22:10 +0000)

http-push: convert process_ls_object and descendants to object_id

Rename one function to reflect that it now uses struct object_id. This
conversion is a prerequisite for converting parse_object.

Note that while the use of a buffer that is exactly forty bytes long
looks questionable, get_oid_hex reads exactly the right number of bytes
and does not require the data to be NUL-terminated.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs/files-backend: convert many internals to struct... brian m. carlson Sat, 6 May 2017 22:10:24 +0000 (22:10 +0000)

refs/files-backend: convert many internals to struct object_id

Convert many of the internals of the files backend to use struct
object_id. Avoid converting public APIs (except one change to
refs/ref-cache.c) to limit the scope of the changes.

Convert one use of get_sha1_hex to parse_oid_hex, and rely on the fact
that a strbuf will be NUL-terminated and that parse_oid_hex will fail on
truncated input to avoid the need to check the length.

This is a requirement to convert parse_object later on.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: convert struct ref_update to use struct object_idbrian m. carlson Sat, 6 May 2017 22:10:23 +0000 (22:10 +0000)

refs: convert struct ref_update to use struct object_id

Convert struct ref_array_item to use struct object_id by changing the
definition and applying the following semantic patch, plus the standard
object_id transforms:

@@
struct ref_update E1;
@@
- E1.new_sha1
+ E1.new_oid.hash

@@
struct ref_update *E1;
@@
- E1->new_sha1
+ E1->new_oid.hash

@@
struct ref_update E1;
@@
- E1.old_sha1
+ E1.old_oid.hash

@@
struct ref_update *E1;
@@
- E1->old_sha1
+ E1->old_oid.hash

This transformation allows us to convert write_ref_to_lockfile, which is
required to convert parse_object.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ref-filter: convert some static functions to struct... brian m. carlson Sat, 6 May 2017 22:10:22 +0000 (22:10 +0000)

ref-filter: convert some static functions to struct object_id

Among the converted functions is a caller of parse_object_buffer, which
we will convert later.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Convert struct ref_array_item to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:21 +0000 (22:10 +0000)

Convert struct ref_array_item to struct object_id

Convert struct ref_array_item to use struct object_id by changing the
definition and applying the following semantic patch, plus the standard
object_id transforms:

@@
struct ref_array_item E1;
@@
- E1.objectname
+ E1.objectname.hash

@@
struct ref_array_item *E1;
@@
- E1->objectname
+ E1->objectname.hash

This transformation allows us to convert get_obj, which is needed to
convert parse_object_buffer.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Convert the verify_pack callback to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:20 +0000 (22:10 +0000)

Convert the verify_pack callback to struct object_id

Make the verify_pack_callback take a pointer to struct object_id.
Change the pack checksum to use GIT_MAX_RAWSZ, even though it is not
strictly an object ID. Doing so ensures resilience against future hash
size changes, and allows us to remove hard-coded assumptions about how
big the buffer needs to be.

Also, use a union to convert the pointer from nth_packed_object_sha1 to
to a pointer to struct object_id. This behavior is compatible with GCC
and clang and explicitly sanctioned by C11. The alternatives are to
just perform a cast, which would run afoul of strict aliasing rules, but
should just work, and changing the pointer into an instance of struct
object_id and copying the value. The latter operation could seriously
bloat memory usage on fsck, which already uses a lot of memory on some
repositories.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Convert lookup_tag to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:19 +0000 (22:10 +0000)

Convert lookup_tag to struct object_id

Convert lookup_tag to take a pointer to struct object_id.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

log-tree: convert to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:18 +0000 (22:10 +0000)

log-tree: convert to struct object_id

Convert the remaining functions to take pointers to struct object_id
instead of pointers to unsigned char, and update the internals of these
functions as well. Among these functions is a caller of lookup_tag,
which we will convert shortly.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Convert lookup_tree to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:17 +0000 (22:10 +0000)

Convert lookup_tree to struct object_id

Convert the lookup_tree function to take a pointer to struct object_id.

The commit was created with manual changes to tree.c, tree.h, and
object.c, plus the following semantic patch:

@@
@@
- lookup_tree(EMPTY_TREE_SHA1_BIN)
+ lookup_tree(&empty_tree_oid)

@@
expression E1;
@@
- lookup_tree(E1.hash)
+ lookup_tree(&E1)

@@
expression E1;
@@
- lookup_tree(E1->hash)
+ lookup_tree(E1)

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/reflog: convert tree_is_complete to take struct... brian m. carlson Sat, 6 May 2017 22:10:16 +0000 (22:10 +0000)

builtin/reflog: convert tree_is_complete to take struct object_id

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tree: convert read_tree_1 to use struct object_id inter... brian m. carlson Sat, 6 May 2017 22:10:15 +0000 (22:10 +0000)

tree: convert read_tree_1 to use struct object_id internally

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Convert lookup_blob to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:14 +0000 (22:10 +0000)

Convert lookup_blob to struct object_id

Convert lookup_blob to take a pointer to struct object_id.

The commit was created with manual changes to blob.c and blob.h, plus
the following semantic patch:

@@
expression E1;
@@
- lookup_blob(E1.hash)
+ lookup_blob(&E1)

@@
expression E1;
@@
- lookup_blob(E1->hash)
+ lookup_blob(E1)

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Convert remaining callers of lookup_blob to object_idbrian m. carlson Sat, 6 May 2017 22:10:13 +0000 (22:10 +0000)

Convert remaining callers of lookup_blob to object_id

All but a few callers of lookup_blob have been converted to struct
object_id. Introduce a temporary, which will be removed later, into
parse_object to ease the transition, and convert the remaining callers
so that we can update lookup_blob to take struct object_id *.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/unpack-objects: convert to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:12 +0000 (22:10 +0000)

builtin/unpack-objects: convert to struct object_id

Convert struct delta_info and struct object_info, as well as the various
functions, to use struct object_id. Convert several hard-coded 20
values to GIT_SHA1_RAWSZ. Among the functions converted is a caller of
lookup_blob, which we will convert shortly.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: convert struct pack_idx_entry to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:11 +0000 (22:10 +0000)

pack: convert struct pack_idx_entry to struct object_id

Convert struct pack_idx_entry to use struct object_id by changing the
definition and applying the following semantic patch, plus the standard
object_id transforms:

@@
struct pack_idx_entry E1;
@@
- E1.sha1
+ E1.oid.hash

@@
struct pack_idx_entry *E1;
@@
- E1->sha1
+ E1->oid.hash

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Convert lookup_commit* to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:10 +0000 (22:10 +0000)

Convert lookup_commit* to struct object_id

Convert lookup_commit, lookup_commit_or_die,
lookup_commit_reference, and lookup_commit_reference_gently to take
struct object_id arguments.

Introduce a temporary in parse_object buffer in order to convert this
function. This is required since in order to convert parse_object and
parse_object_buffer, lookup_commit_reference_gently and
lookup_commit_or_die would need to be converted. Not introducing a
temporary would therefore require that lookup_commit_or_die take a
struct object_id *, but lookup_commit would take unsigned char *,
leaving a confusing and hard-to-use interface.

parse_object_buffer will lose this temporary in a later patch.

This commit was created with manual changes to commit.c, commit.h, and
object.c, plus the following semantic patch:

@@
expression E1, E2;
@@
- lookup_commit_reference_gently(E1.hash, E2)
+ lookup_commit_reference_gently(&E1, E2)

@@
expression E1, E2;
@@
- lookup_commit_reference_gently(E1->hash, E2)
+ lookup_commit_reference_gently(E1, E2)

@@
expression E1;
@@
- lookup_commit_reference(E1.hash)
+ lookup_commit_reference(&E1)

@@
expression E1;
@@
- lookup_commit_reference(E1->hash)
+ lookup_commit_reference(E1)

@@
expression E1;
@@
- lookup_commit(E1.hash)
+ lookup_commit(&E1)

@@
expression E1;
@@
- lookup_commit(E1->hash)
+ lookup_commit(E1)

@@
expression E1, E2;
@@
- lookup_commit_or_die(E1.hash, E2)
+ lookup_commit_or_die(&E1, E2)

@@
expression E1, E2;
@@
- lookup_commit_or_die(E1->hash, E2)
+ lookup_commit_or_die(E1, E2)

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Convert remaining callers of lookup_commit_reference... brian m. carlson Sat, 6 May 2017 22:10:09 +0000 (22:10 +0000)

Convert remaining callers of lookup_commit_reference* to object_id

There are a small number of remaining callers of lookup_commit_reference
and lookup_commit_reference_gently that still need to be converted to
struct object_id. Convert these.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/tag: convert to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:08 +0000 (22:10 +0000)

builtin/tag: convert to struct object_id

Parts of this module call lookup_commit_reference, which we want to
convert. The module is small and mostly self-contained, so convert the
rest of it while we're at it.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer: convert some functions to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:07 +0000 (22:10 +0000)

sequencer: convert some functions to struct object_id

Convert update_squash_messages and is_index_unchanged to struct
object_id. These are callers of lookup_commit and
lookup_commit_reference, which we want to convert.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

shallow: convert shallow registration functions to... brian m. carlson Sat, 6 May 2017 22:10:06 +0000 (22:10 +0000)

shallow: convert shallow registration functions to object_id

Convert register_shallow and unregister_shallow to take struct
object_id. register_shallow is a caller of lookup_commit, which we will
convert later. It doesn't make sense for the registration and
unregistration functions to have incompatible interfaces, so convert
them both.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

revision: convert prepare_show_merge to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:05 +0000 (22:10 +0000)

revision: convert prepare_show_merge to struct object_id

This is a caller of lookup_commit_or_die, which we will convert later
on.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

notes-utils: convert internals to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:04 +0000 (22:10 +0000)

notes-utils: convert internals to struct object_id

Convert the internals of create_notes_comit and commit_notes to use
struct object_id.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-push: convert some static functions to struct... brian m. carlson Sat, 6 May 2017 22:10:03 +0000 (22:10 +0000)

http-push: convert some static functions to struct object_id

Among the functions converted is a caller of lookup_commit_or_die, which
we will convert later on.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tag: convert parse_tag_buffer to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:02 +0000 (22:10 +0000)

tag: convert parse_tag_buffer to struct object_id

Specify some constants in terms of GIT_SHA1_HEXSZ, and convert a
get_sha1_hex into parse_oid_hex to avoid needing to specify additional
constants.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/verify-commit: convert to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:01 +0000 (22:10 +0000)

builtin/verify-commit: convert to struct object_id

This is a prerequisite to convert to lookup_commit, which we will
convert later.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reflog_expire: convert to struct object_idbrian m. carlson Sat, 6 May 2017 22:10:00 +0000 (22:10 +0000)

reflog_expire: convert to struct object_id

Adjust the callback functions to take struct object_id * instead of
unsigned char *, and modify related static functions accordingly.

Introduce a temporary object_id instance into files_reflog_expire and
copy the SHA-1 value passed in. This is necessary because the sha1
parameter can come indirectly from get_sha1. Without the temporary, it
would require much more refactoring to be able to convert this function.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parse-options-cb: convert to struct object_idbrian m. carlson Sat, 6 May 2017 22:09:59 +0000 (22:09 +0000)

parse-options-cb: convert to struct object_id

This is a caller of lookup_commit_reference, which we will soon convert.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

notes-cache: convert to struct object_idbrian m. carlson Sat, 6 May 2017 22:09:58 +0000 (22:09 +0000)

notes-cache: convert to struct object_id

Convert as many instances of unsigned char [20] as possible. Update the
callers of notes_cache_get and notes_cache_put to use the new interface.
Among the functions updated are callers of
lookup_commit_reference_gently, which we will soon convert.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: convert merge_submodule to use struct object_idbrian m. carlson Sat, 6 May 2017 22:09:57 +0000 (22:09 +0000)

submodule: convert merge_submodule to use struct object_id

This is a caller of lookup_commit_reference, which we will convert
later.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: convert to struct object_idbrian m. carlson Sat, 6 May 2017 22:09:56 +0000 (22:09 +0000)

fast-import: convert to struct object_id

Convert the remaining parts of fast-import.c to use struct object_id.
Convert several instances of get_sha1_hex to parse_oid_hex to avoid
needing to specify constants. Convert other hardcoded values to named
constants. Finally, use the is_empty_tree_oid function instead of a
direct comparison against a fixed string.

Note that the odd computation with GIT_MAX_HEXSZ is due to the insertion
of a slash between every two hex digits in the path, plus one for the
terminating NUL.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule_uses_worktrees(): plug memory leakJohannes Schindelin Thu, 4 May 2017 13:59:19 +0000 (15:59 +0200)

submodule_uses_worktrees(): plug memory leak

There is really no reason why we would need to hold onto the allocated
string longer than necessary.

Reported by Coverity.

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

show_worktree(): plug memory leakJohannes Schindelin Thu, 4 May 2017 13:59:13 +0000 (15:59 +0200)

show_worktree(): plug memory leak

The buffer allocated by shorten_unambiguous_ref() needs to be released.

Discovered by Coverity.

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

name-rev: avoid leaking memory in the `deref` caseJohannes Schindelin Thu, 4 May 2017 13:59:06 +0000 (15:59 +0200)

name-rev: avoid leaking memory in the `deref` case

When the `name_rev()` function is asked to dereference the tip name, it
allocates memory. But when it turns out that another tip already
described the commit better than the current one, we forgot to release
the memory.

Pointed out by Coverity.

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

remote: plug memory leak in match_explicit()Johannes Schindelin Thu, 4 May 2017 13:59:01 +0000 (15:59 +0200)

remote: plug memory leak in match_explicit()

The `guess_ref()` returns an allocated buffer of which `make_linked_ref()`
does not take custody (`alloc_ref()` makes a copy), therefore we need to
release the buffer afterwards.

Noticed via Coverity.

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

add_reflog_for_walk: avoid memory leakJohannes Schindelin Thu, 4 May 2017 13:58:42 +0000 (15:58 +0200)

add_reflog_for_walk: avoid memory leak

We free()d the `log` buffer when dwim_log() returned 1, but not when it
returned a larger value (which meant that it still allocated the buffer
but we simply ignored it).

While in the vicinity, make sure that the `reflogs` structure as well as
the `branch` variable are released properly, too.

Identified by Coverity.

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

shallow: avoid memory leakJohannes Schindelin Thu, 4 May 2017 13:58:35 +0000 (15:58 +0200)

shallow: avoid memory leak

Reported by Coverity.

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

line-log: avoid memory leakJohannes Schindelin Thu, 4 May 2017 13:58:01 +0000 (15:58 +0200)

line-log: avoid memory leak

Discovered by Coverity.

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

receive-pack: plug memory leak in update()Johannes Schindelin Thu, 4 May 2017 13:57:55 +0000 (15:57 +0200)

receive-pack: plug memory leak in update()

Reported via Coverity.

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

fast-export: avoid leaking memory in handle_tag()Johannes Schindelin Thu, 4 May 2017 13:57:33 +0000 (15:57 +0200)

fast-export: avoid leaking memory in handle_tag()

Reported by, you guessed it, Coverity.

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

mktree: plug memory leaks reported by CoverityJohannes Schindelin Thu, 4 May 2017 13:57:28 +0000 (15:57 +0200)

mktree: plug memory leaks reported by Coverity

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

pack-redundant: plug memory leakJohannes Schindelin Thu, 4 May 2017 13:56:54 +0000 (15:56 +0200)

pack-redundant: plug memory leak

Identified via Coverity.

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

setup_discovered_git_dir(): plug memory leakJohannes Schindelin Thu, 4 May 2017 13:56:51 +0000 (15:56 +0200)

setup_discovered_git_dir(): plug memory leak

The setup_explicit_git_dir() function does not take custody of the string
passed as first parameter; we have to release it if we turned the value of
git_dir into an absolute path.

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

setup_bare_git_dir(): help static analysisJohannes Schindelin Thu, 4 May 2017 13:56:47 +0000 (15:56 +0200)

setup_bare_git_dir(): help static analysis

Coverity reported a memory leak in this function. However, it can only
be called once, as setup_git_directory() changes global state and hence
is not reentrant.

Mark the variable as static to indicate that this is a singleton.

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

split_commit_in_progress(): simplify & fix memory leakJohannes Schindelin Thu, 4 May 2017 13:56:44 +0000 (15:56 +0200)

split_commit_in_progress(): simplify & fix memory leak

This function did a whole lot of unnecessary work, such as reading in
four files just to figure out that, oh, hey, we do not need to look at
them after all because the HEAD is not detached.

Simplify the entire function to return early when possible, to read in
the files only when necessary, and to release the allocated memory
always (there was a leak, reported via Coverity, where we failed to
release the allocated strings if the HEAD is not detached).

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

checkout: fix memory leakJohannes Schindelin Thu, 4 May 2017 13:56:40 +0000 (15:56 +0200)

checkout: fix memory leak

This change addresses part of the NEEDSWORK comment above the code,
therefore the comment needs to be adjusted, too.

Discovered via Coverity.

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

cat-file: fix memory leakJohannes Schindelin Thu, 4 May 2017 13:56:17 +0000 (15:56 +0200)

cat-file: fix memory leak

Discovered by Coverity.

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

mailinfo & mailsplit: check for EOF while parsingJohannes Schindelin Thu, 4 May 2017 13:56:14 +0000 (15:56 +0200)

mailinfo & mailsplit: check for EOF while parsing

While POSIX states that it is okay to pass EOF to isspace() (and it seems
to be implied that EOF should *not* be treated as whitespace), and also to
pass EOF to ungetc() (which seems to be intended to fail without buffering
the character), it is much better to handle these cases explicitly. Not
only does it reduce head-scratching (and helps static analysis avoid
reporting false positives), it also lets us handle files containing
nothing but whitespace by erroring out.

Reported via Coverity.

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

status: close file descriptor after reading git-rebase... Johannes Schindelin Thu, 4 May 2017 13:55:52 +0000 (15:55 +0200)

status: close file descriptor after reading git-rebase-todo

Reported via Coverity.

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

difftool: address a couple of resource/memory leaksJohannes Schindelin Thu, 4 May 2017 13:55:48 +0000 (15:55 +0200)

difftool: address a couple of resource/memory leaks

This change plugs a couple of memory leaks and makes sure that the file
descriptor is closed in run_dir_diff().

Spotted by Coverity.

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

get_mail_commit_oid(): avoid resource leakJohannes Schindelin Thu, 4 May 2017 13:55:45 +0000 (15:55 +0200)

get_mail_commit_oid(): avoid resource leak

When we fail to read, or parse, the file, we still want to close the file
descriptor and release the strbuf.

Reported via Coverity.

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

git_config_rename_section_in_file(): avoid resource... Johannes Schindelin Thu, 4 May 2017 13:55:41 +0000 (15:55 +0200)

git_config_rename_section_in_file(): avoid resource leak

In case of errors, we really want the file descriptor to be closed.

Discovered by a Coverity scan.

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

add_commit_patch_id(): avoid allocating memory unnecess... Johannes Schindelin Thu, 4 May 2017 13:55:38 +0000 (15:55 +0200)

add_commit_patch_id(): avoid allocating memory unnecessarily

It would appear that we allocate (and forget to release) memory if the
patch ID is not even defined.

Reported by the Coverity tool.

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

winansi: avoid buffer overrunJohannes Schindelin Thu, 4 May 2017 13:55:34 +0000 (15:55 +0200)

winansi: avoid buffer overrun

When we could not convert the UTF-8 sequence into Unicode for writing to
the Console, we should not try to write an insanely-long sequence of
invalid wide characters (mistaking the negative return value for an
unsigned length).

Reported by Coverity.

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

winansi: avoid use of uninitialized valueJohannes Schindelin Thu, 4 May 2017 13:55:29 +0000 (15:55 +0200)

winansi: avoid use of uninitialized value

To initialize the foreground color attributes of "plain text", our ANSI
emulation tries to infer them from the currently attached console while
running the is_console() function. This function first tries to detect any
console attached to stdout, then it is called with stderr.

If neither stdout nor stderr has any console attached, it does not
actually matter what we use for "plain text" attributes, as we never need
to output any text to any console in that case.

However, after working on stdout and stderr, is_console() is called with
stdin, and it still tries to initialize the "plain text" attributes if
they had not been initialized earlier. In this case, we cannot detect any
attributes, and we used an uninitialized value for them.

Naturally, Coverity complained about this use case because it could not
reason about the code deeply enough to figure out that we do not even use
those attributes in that case.

Let's just initialize the value to 0 in that case, both to avoid future
Coverity reports, and to help catch future regressions in case anybody
changes the order of the is_console() calls (which would make the text
black on black).

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

mingw: avoid memory leak when splitting PATHJohannes Schindelin Thu, 4 May 2017 13:55:24 +0000 (15:55 +0200)

mingw: avoid memory leak when splitting PATH

In the (admittedly, concocted) case that PATH consists only of path
delimiters, we would leak the duplicated string.

Reported by Coverity.

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

am: check return value of resolve_refdup before using... René Scharfe Sat, 6 May 2017 17:13:56 +0000 (19:13 +0200)

am: check return value of resolve_refdup before using hash

If resolve_refdup() fails it returns NULL and possibly leaves its hash
output parameter untouched. Make sure to use it only if the function
succeeded, in order to avoid accessing uninitialized memory.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

checkout: check return value of resolve_refdup before... René Scharfe Sat, 6 May 2017 17:13:52 +0000 (19:13 +0200)

checkout: check return value of resolve_refdup before using hash

If resolve_refdup() fails it returns NULL and possibly leaves its hash
output parameter untouched. Make sure to use it only if the function
succeeded, in order to avoid accessing uninitialized memory.

Found with t/t2011-checkout-invalid-head.sh --valgrind.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

p3400: add perf tests for rebasing many changesChristian Couder Fri, 5 May 2017 14:57:13 +0000 (16:57 +0200)

p3400: add perf tests for rebasing many changes

Rebasing onto many changes is interesting, but it's also
interesting to see what happens when rebasing many changes.

And while at it, let's also look at the impact of using a
split index.

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

split-index: add and use unshare_split_index()Nguyễn Thái Ngọc Duy Fri, 5 May 2017 14:57:12 +0000 (16:57 +0200)

split-index: add and use unshare_split_index()

When split-index is being used, we have two cache_entry arrays in
index_state->cache[] and index_state->split_index->base->cache[].

index_state->cache[] may share the same entries with base->cache[] so
we can quickly determine what entries are shared. This makes memory
management tricky, we can't free base->cache[] until we know
index_state->cache[] does not point to any of those entries.

unshare_split_index() is added for this purpose, to find shared
entries and either duplicate them in index_state->cache[], or discard
them. Either way it should be safe to free base->cache[] after
unshare_split_index().

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

doc: replace a couple of broken gmane linksÆvar Arnfjörð Bjarmason Fri, 5 May 2017 10:08:03 +0000 (10:08 +0000)

doc: replace a couple of broken gmane links

Replace a couple of broken links to gmane with links to other
archives. See commit 54471fdcc3 ("README: replace gmane link with
public-inbox", 2016-12-15) for prior art.

With this change there's still 4 references left in the code:

$ git grep -E '(article|thread)\.gmane.org' -- |grep -v RelNotes|wc -l
4

I couldn't find alternative links for those.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: recurse into nested submodules for inline diffStefan Beller Thu, 4 May 2017 21:43:55 +0000 (14:43 -0700)

diff: recurse into nested submodules for inline diff

When fd47ae6a5b (diff: teach diff to display submodule difference with an
inline diff, 2016-08-31) was introduced, we did not think of recursing
into nested submodules.

When showing the inline diff for submodules, automatically recurse
into nested submodules as well with inline submodule diffs.

Signed-off-by: Stefan Beller <sbeller@google.com>
Acked-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: convert fill_directory to take an indexBrandon Williams Fri, 5 May 2017 19:53:34 +0000 (12:53 -0700)

dir: convert fill_directory to take an index

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: convert read_directory to take an indexBrandon Williams Fri, 5 May 2017 19:53:33 +0000 (12:53 -0700)

dir: convert read_directory to take an index

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: convert read_directory_recursive to take an indexBrandon Williams Fri, 5 May 2017 19:53:32 +0000 (12:53 -0700)

dir: convert read_directory_recursive to take an index

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: convert open_cached_dir to take an indexBrandon Williams Fri, 5 May 2017 19:53:31 +0000 (12:53 -0700)

dir: convert open_cached_dir to take an index

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: convert is_excluded to take an indexBrandon Williams Fri, 5 May 2017 19:53:30 +0000 (12:53 -0700)

dir: convert is_excluded to take an index

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: convert prep_exclude to take an indexBrandon Williams Fri, 5 May 2017 19:53:29 +0000 (12:53 -0700)

dir: convert prep_exclude to take an index

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: convert add_excludes to take an indexBrandon Williams Fri, 5 May 2017 19:53:28 +0000 (12:53 -0700)

dir: convert add_excludes to take an index

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: convert is_excluded_from_list to take an indexBrandon Williams Fri, 5 May 2017 19:53:27 +0000 (12:53 -0700)

dir: convert is_excluded_from_list to take an index

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: convert last_exclude_matching_from_list to take... Brandon Williams Fri, 5 May 2017 19:53:26 +0000 (12:53 -0700)

dir: convert last_exclude_matching_from_list to take an index

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: convert dir_add* to take an indexBrandon Williams Fri, 5 May 2017 19:53:25 +0000 (12:53 -0700)

dir: convert dir_add* to take an index

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: convert get_dtype to take indexBrandon Williams Fri, 5 May 2017 19:53:24 +0000 (12:53 -0700)

dir: convert get_dtype to take index

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: convert directory_exists_in_index to take indexBrandon Williams Fri, 5 May 2017 19:53:23 +0000 (12:53 -0700)

dir: convert directory_exists_in_index to take index

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: convert read_skip_worktree_file_from_index to... Brandon Williams Fri, 5 May 2017 19:53:22 +0000 (12:53 -0700)

dir: convert read_skip_worktree_file_from_index to take an index

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir: stop using the index compatibility macrosBrandon Williams Fri, 5 May 2017 19:53:21 +0000 (12:53 -0700)

dir: stop using the index compatibility macros

In order to make it clearer where the_index is being referenced, stop
using the index compatibility macros in dir.c. This is to make it
easier to identify the functions which need to be convert to taking in a
'struct index_state' as a parameter.

The end goal would be to eliminate the need to reference global index
state in dir.c.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>