<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/tests/submodule/lookup.c, branch ethomson/https_proxy</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/'/>
<entry>
<title>Convert usage of `git_buf_free` to new `git_buf_dispose`</title>
<updated>2018-06-10T17:34:37+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2018-02-08T11:14:48+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=ecf4f33a4e327a91496f72816f9f02d923e5af05'/>
<id>ecf4f33a4e327a91496f72816f9f02d923e5af05</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: submodule: do not rely on config iteration order</title>
<updated>2018-06-06T09:32:14+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2018-06-06T07:23:01+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=8178c70ff43efdc0f176f32a7b6e5c8f55f3e67c'/>
<id>8178c70ff43efdc0f176f32a7b6e5c8f55f3e67c</id>
<content type='text'>
The test submodule::lookup::duplicated_path, which tries to verify that
we detect submodules with duplicated paths, currently relies on the
gitmodules file of "submod2_target". While this file has two gitmodules
with the same path, one of these gitmodules has an empty name and thus
does not pass `git_submodule_name_is_valid`. Because of this, the test
is in fact dependent on the iteration order in which we process the
submodules. In fact the "valid" submodule comes first, the "invalid"
submodule will cause the desired error. In fact the "invalid" submodule
comes first, it will be skipped due to its name being invalid, and we
will not see the desired error. While this works on the master branch
just right due to the refactoring of our config code, where iteration
order is now deterministic, this breaks on all older maintenance
branches.

Fix the issue by simply using `cl_git_rewritefile` to rewrite the
gitmodules file. This greatly simplifies the test and also makes the
intentions of it much clearer.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test submodule::lookup::duplicated_path, which tries to verify that
we detect submodules with duplicated paths, currently relies on the
gitmodules file of "submod2_target". While this file has two gitmodules
with the same path, one of these gitmodules has an empty name and thus
does not pass `git_submodule_name_is_valid`. Because of this, the test
is in fact dependent on the iteration order in which we process the
submodules. In fact the "valid" submodule comes first, the "invalid"
submodule will cause the desired error. In fact the "invalid" submodule
comes first, it will be skipped due to its name being invalid, and we
will not see the desired error. While this works on the master branch
just right due to the refactoring of our config code, where iteration
order is now deterministic, this breaks on all older maintenance
branches.

Fix the issue by simply using `cl_git_rewritefile` to rewrite the
gitmodules file. This greatly simplifies the test and also makes the
intentions of it much clearer.
</pre>
</div>
</content>
</entry>
<entry>
<title>submodule: detect duplicated submodule paths</title>
<updated>2018-05-30T08:35:12+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2018-05-30T06:35:06+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=b2a389c87019c729ffaf179a338236dd129b473c'/>
<id>b2a389c87019c729ffaf179a338236dd129b473c</id>
<content type='text'>
When loading submodule names, we build a map of submodule paths and
their respective names. While looping over the configuration keys,
we do not check though whether a submodule path was seen already. This
leads to a memory leak in case we have multiple submodules with the same
path, as we just overwrite the old value in the map in that case.

Fix the error by verifying that the path to be added is not yet part of
the string map. Git does not allow to have multiple submodules for a
path anyway, so we now do the same and detect this duplication,
reporting it to the user.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When loading submodule names, we build a map of submodule paths and
their respective names. While looping over the configuration keys,
we do not check though whether a submodule path was seen already. This
leads to a memory leak in case we have multiple submodules with the same
path, as we just overwrite the old value in the map in that case.

Fix the error by verifying that the path to be added is not yet part of
the string map. Git does not allow to have multiple submodules for a
path anyway, so we now do the same and detect this duplication,
reporting it to the user.
</pre>
</div>
</content>
</entry>
<entry>
<title>Submodule API should report .gitmodules parse errors</title>
<updated>2018-03-27T17:03:19+00:00</updated>
<author>
<name>Sven Strickroth</name>
<email>email@cs-ware.de</email>
</author>
<published>2018-02-08T11:36:47+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=e55b5373fbc008ef4240d33068374ecfe68dddf3'/>
<id>e55b5373fbc008ef4240d33068374ecfe68dddf3</id>
<content type='text'>
Signed-off-by: Sven Strickroth &lt;email@cs-ware.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Sven Strickroth &lt;email@cs-ware.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>submodule: refuse lookup in bare repositories</title>
<updated>2017-08-25T16:15:12+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-07-10T10:25:43+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=477b3e047426d7ccddb6028416ff0fcc2541a0fd'/>
<id>477b3e047426d7ccddb6028416ff0fcc2541a0fd</id>
<content type='text'>
While it is technically possible to look up submodules inside of a
bare repository by reading the submodule configuration of a specific
commit, we do not offer this functionality right now. As such, calling
both `git_submodule_lookup` and `git_submodule_foreach` should error out
early when these functions encounter a bare repository. While
`git_submodule_lookup` already does return an error due to not being
able to parse the configuration, `git_submodule_foreach` simply returns
success and never invokes the callback function.

Fix the issue by having both functions check whether the repository is
bare and returning an error in that case.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While it is technically possible to look up submodules inside of a
bare repository by reading the submodule configuration of a specific
commit, we do not offer this functionality right now. As such, calling
both `git_submodule_lookup` and `git_submodule_foreach` should error out
early when these functions encounter a bare repository. While
`git_submodule_lookup` already does return an error due to not being
able to parse the configuration, `git_submodule_foreach` simply returns
success and never invokes the callback function.

Fix the issue by having both functions check whether the repository is
bare and returning an error in that case.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: submodule: add explicit cleanup function in lookup tests</title>
<updated>2017-08-25T16:05:48+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-07-10T09:55:33+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=a889c05f2abfec5e45fa50faf7307c06c7c9b25b'/>
<id>a889c05f2abfec5e45fa50faf7307c06c7c9b25b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: submodule: fix declaration of test</title>
<updated>2017-08-25T16:05:48+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-07-10T09:52:08+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=64d1e0b37c036ea869c44720257734be3186c698'/>
<id>64d1e0b37c036ea869c44720257734be3186c698</id>
<content type='text'>
The testcase "submodule::lookup::cached" was declared with a single
underscore separating the test suide and test name, only. As the clar
parser only catches tests with two underscores, it was never executed.
Add in the second underscore to actually have it detected and executed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The testcase "submodule::lookup::cached" was declared with a single
underscore separating the test suide and test name, only. As the clar
parser only catches tests with two underscores, it was never executed.
Add in the second underscore to actually have it detected and executed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow for caching of submodules.</title>
<updated>2017-01-20T22:33:56+00:00</updated>
<author>
<name>Brock Peabody</name>
<email>bpeabody@twosigma.com</email>
</author>
<published>2016-11-23T23:32:48+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=4d99c4cfc604bb141fd4e1423e934ebd3fb7e2a7'/>
<id>4d99c4cfc604bb141fd4e1423e934ebd3fb7e2a7</id>
<content type='text'>
Added `git_repository_submodule_cache_all` to initialze a cache of
submodules on the repository so that operations looking up N
submodules are O(N) and not O(N^2).  Added a
`git_repository_submodule_cache_clear` function to remove the cache.

Also optimized the function that loads all submodules as it was itself
O(N^2) w.r.t the number of submodules, having to loop through the
`.gitmodules` file once per submodule.  I changed it to process the
`.gitmodules` file once, into a map.

Signed-off-by: David Turner &lt;dturner@twosigma.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added `git_repository_submodule_cache_all` to initialze a cache of
submodules on the repository so that operations looking up N
submodules are O(N) and not O(N^2).  Added a
`git_repository_submodule_cache_clear` function to remove the cache.

Also optimized the function that loads all submodules as it was itself
O(N^2) w.r.t the number of submodules, having to loop through the
`.gitmodules` file once per submodule.  I changed it to process the
`.gitmodules` file once, into a map.

Signed-off-by: David Turner &lt;dturner@twosigma.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>typos in comments</title>
<updated>2015-12-21T19:18:07+00:00</updated>
<author>
<name>Dmitriy Olshevskiy</name>
<email>olshevskiy87@bk.ru</email>
</author>
<published>2015-12-21T17:49:14+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=91f0d186b4efee8ccd5d0bbedf6b806a4f5e2a3a'/>
<id>91f0d186b4efee8ccd5d0bbedf6b806a4f5e2a3a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix a couple of warnings</title>
<updated>2015-09-18T10:06:55+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-09-18T10:06:55+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=dfe2856d0f3eb66e9199d28a73fab71cad0f3ff1'/>
<id>dfe2856d0f3eb66e9199d28a73fab71cad0f3ff1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
