<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/fetch-pack.c, branch v1.8.2.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.8.2.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.8.2.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2012-10-29T07:40:29Z</updated>
<entry>
<title>fetch-pack: move core code to libgit.a</title>
<updated>2012-10-29T07:40:29Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-10-26T15:53:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=745f7a8cacae55df3e00507344d8db2a31eb57e8'/>
<id>urn:sha1:745f7a8cacae55df3e00507344d8db2a31eb57e8</id>
<content type='text'>
fetch_pack() is used by transport.c, part of libgit.a while it stays
in builtin/fetch-pack.c. Move it to fetch-pack.c so that we won't get
undefined reference if a program that uses libgit.a happens to pull it
in.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>fetch-pack: remove global (static) configuration variable "args"</title>
<updated>2012-10-29T07:08:30Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-10-26T15:53:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f8eb3036d0cc1838cc6865884b1648ff50a4f804'/>
<id>urn:sha1:f8eb3036d0cc1838cc6865884b1648ff50a4f804</id>
<content type='text'>
This helps removes the hack in fetch_pack() that copies my_args to args.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>fetch-pack: eliminate spurious error messages</title>
<updated>2012-09-12T18:46:32Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2012-09-09T06:19:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5f0fc64513c8cb638e0d6010005d8e86c9dbca3a'/>
<id>urn:sha1:5f0fc64513c8cb638e0d6010005d8e86c9dbca3a</id>
<content type='text'>
It used to be that if "--all", "--depth", and also explicit references
were sought, then the explicit references were not handled correctly
in filter_refs() because the "--all --depth" code took precedence over
the explicit reference handling, and the explicit references were
never noted as having been found.  So check for explicitly sought
references before proceeding to the "--all --depth" logic.

This fixes two test cases in t5500.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cmd_fetch_pack(): simplify computation of return value</title>
<updated>2012-09-12T18:46:32Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2012-09-09T06:19:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b285668dd23952b96d716aac769c0ed1080d11d3'/>
<id>urn:sha1:b285668dd23952b96d716aac769c0ed1080d11d3</id>
<content type='text'>
Set the final value at initialization rather than initializing it then
sometimes changing it.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch-pack: report missing refs even if no existing refs were received</title>
<updated>2012-09-12T18:46:32Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2012-09-09T06:19:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=778e7543d20531bec93d5c9965f32541e78b8e34'/>
<id>urn:sha1:778e7543d20531bec93d5c9965f32541e78b8e34</id>
<content type='text'>
This fixes a test in t5500.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cmd_fetch_pack(): return early if finish_connect() fails</title>
<updated>2012-09-12T18:46:31Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2012-09-09T06:19:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7418f1a0371fd935de6cbe718bbdd567070e9d17'/>
<id>urn:sha1:7418f1a0371fd935de6cbe718bbdd567070e9d17</id>
<content type='text'>
This simplifies the logic without changing the behavior.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>filter_refs(): simplify logic</title>
<updated>2012-09-12T18:46:31Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2012-09-09T06:19:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f537cfa7501de5e4dcdac55a95515e9a2ff880e3'/>
<id>urn:sha1:f537cfa7501de5e4dcdac55a95515e9a2ff880e3</id>
<content type='text'>
Simplify flow within loop: first decide whether to keep the reference,
then keep/free it.  This makes it clearer that each ref has exactly
two possible destinies, and removes duplication of the code for
appending the reference to the linked list.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>filter_refs(): build refs list as we go</title>
<updated>2012-09-12T18:46:31Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2012-09-09T06:19:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5096e4875303038ffc34af96c28cf2a2b7e103a6'/>
<id>urn:sha1:5096e4875303038ffc34af96c28cf2a2b7e103a6</id>
<content type='text'>
Instead of temporarily storing matched refs to temporary array
"return_refs", simply append them to newlist as we go.  This changes
the order of references in newlist to strictly sorted if "--all" and
"--depth" and named references are all specified, but that usage is
broken anyway (see the last two tests in t5500).

This changes the last test in t5500 from segfaulting into just
emitting a spurious error (this will be fixed in a moment).

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>filter_refs(): delete matched refs from sought list</title>
<updated>2012-09-12T18:46:31Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2012-09-09T06:19:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4ba159996f6c1b0d6dd0a2a8bd9d6f5b342a4aa5'/>
<id>urn:sha1:4ba159996f6c1b0d6dd0a2a8bd9d6f5b342a4aa5</id>
<content type='text'>
Remove any references that are available from the remote from the
sought list (rather than overwriting their names with NUL characters,
as previously).  Mark matching entries by writing a non-NULL pointer
to string_list_item::util during the iteration, then use
filter_string_list() later to filter out the entries that have been
marked.

Document this aspect of fetch_pack() in a comment in the header file.
(More documentation is obviously still needed.)

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch_pack(): update sought-&gt;nr to reflect number of unique entries</title>
<updated>2012-09-12T18:46:31Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2012-09-09T06:19:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4c58f13ba67f9dbe67a351de61703a2db20712cc'/>
<id>urn:sha1:4c58f13ba67f9dbe67a351de61703a2db20712cc</id>
<content type='text'>
fetch_pack() removes duplicates from the "sought" list, thereby
shrinking the list.  But previously, the caller was not informed about
the shrinkage.  This would cause a spurious error message to be
emitted by cmd_fetch_pack() if "git fetch-pack" is called with
duplicate refnames.

Instead, remove duplicates using string_list_remove_duplicates(),
which adjusts sought-&gt;nr to reflect the new length of the list.

The last test of t5500 inexplicably *required* "git fetch-pack" to
fail when fetching a list of references that contains duplicates;
i.e., it insisted on the buggy behavior.  So change the test to expect
the correct behavior.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
