<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs.h, branch v2.15.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.15.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.15.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-10-03T06:42:48Z</updated>
<entry>
<title>Merge branch 'sd/branch-copy'</title>
<updated>2017-10-03T06:42:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-10-03T06:42:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3b48045c6c73a51834a2f83440a30225485ee431'/>
<id>urn:sha1:3b48045c6c73a51834a2f83440a30225485ee431</id>
<content type='text'>
"git branch" learned "-c/-C" to create a new branch by copying an
existing one.

* sd/branch-copy:
  branch: fix "copy" to never touch HEAD
  branch: add a --copy (-c) option to go with --move (-m)
  branch: add test for -m renaming multiple config sections
  config: create a function to format section headers
</content>
</entry>
<entry>
<title>Merge branch 'rs/resolve-ref-optional-result'</title>
<updated>2017-09-28T05:47:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-09-28T05:47:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=73ecdc606eedbfd98ec66d50d44b3374425fd13b'/>
<id>urn:sha1:73ecdc606eedbfd98ec66d50d44b3374425fd13b</id>
<content type='text'>
Code clean-up.

* rs/resolve-ref-optional-result:
  refs: pass NULL to resolve_ref_unsafe() if hash is not needed
  refs: pass NULL to refs_resolve_ref_unsafe() if hash is not needed
  refs: make sha1 output parameter of refs_resolve_ref_unsafe() optional
</content>
</entry>
<entry>
<title>Merge branch 'tg/refs-allowed-flags'</title>
<updated>2017-09-25T06:24:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-09-25T06:24:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d019010559b26784b0aea6cf08b43f576ef027f9'/>
<id>urn:sha1:d019010559b26784b0aea6cf08b43f576ef027f9</id>
<content type='text'>
API error-proofing which happens to also squelch warnings from GCC.

* tg/refs-allowed-flags:
  refs: strip out not allowed flags from ref_transaction_update
</content>
</entry>
<entry>
<title>refs: make sha1 output parameter of refs_resolve_ref_unsafe() optional</title>
<updated>2017-09-24T01:18:18Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-09-23T09:41:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=54fad6614fc6b61ee6eb4a5b3daa7a2239019b49'/>
<id>urn:sha1:54fad6614fc6b61ee6eb4a5b3daa7a2239019b49</id>
<content type='text'>
Allow callers of refs_resolve_ref_unsafe() to pass NULL if they don't
need the resolved hash value.  We already allow the same for the flags
parameter.  This new leniency is inherited by the various wrappers like
resolve_ref_unsafe().

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: strip out not allowed flags from ref_transaction_update</title>
<updated>2017-09-14T05:46:05Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2017-09-12T22:59:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c788c54cde5f7d52e4db9d4971545c3b2456ddcf'/>
<id>urn:sha1:c788c54cde5f7d52e4db9d4971545c3b2456ddcf</id>
<content type='text'>
Callers are only allowed to pass certain flags into
ref_transaction_update, other flags are internal to it.  To prevent
mistakes from the callers, strip the internal only flags out before
continuing.

This was noticed because of a compiler warning gcc 7.1.1 issued about
passing a NULL parameter as second parameter to memcpy (through
hashcpy):

In file included from refs.c:5:0:
refs.c: In function ‘ref_transaction_verify’:
cache.h:948:2: error: argument 2 null where non-null expected [-Werror=nonnull]
  memcpy(sha_dst, sha_src, GIT_SHA1_RAWSZ);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from git-compat-util.h:165:0,
                 from cache.h:4,
                 from refs.c:5:
/usr/include/string.h:43:14: note: in a call to function ‘memcpy’ declared here
 extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
              ^~~~~~

The call to hascpy in ref_transaction_add_update is protected by the
passed in flags, but as we only add flags there, gcc notices
REF_HAVE_NEW or REF_HAVE_OLD flags could be passed in from the outside,
which would potentially result in passing in NULL as second parameter to
memcpy.

Fix both the compiler warning, and make the interface safer for its
users by stripping the internal flags out.

Suggested-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: remove dead for_each_*_submodule()</title>
<updated>2017-08-24T21:56:28Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2017-08-23T12:36:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=419221c1065981311b1a0f4a469d4d8a9ea09f54'/>
<id>urn:sha1:419221c1065981311b1a0f4a469d4d8a9ea09f54</id>
<content type='text'>
These are used in revision.c. After the last patch they are replaced
with the refs_ version. Delete them.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs.c: move for_each_remote_ref_submodule() to submodule.c</title>
<updated>2017-08-24T21:56:10Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2017-08-23T12:36:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2e2d4040bd1c26eccfe0e54b3ab73e13d4bf45e0'/>
<id>urn:sha1:2e2d4040bd1c26eccfe0e54b3ab73e13d4bf45e0</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>revision.c: use refs_for_each*() instead of for_each_*_submodule()</title>
<updated>2017-08-24T21:52:33Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2017-08-23T12:36:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=073cf63c523e3e88a8e002fbc04fc1876f074aef'/>
<id>urn:sha1:073cf63c523e3e88a8e002fbc04fc1876f074aef</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: add refs_head_ref()</title>
<updated>2017-08-24T21:47:31Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2017-08-23T12:36:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=62f0b399e00f38751834e688677ab49fcccd28fe'/>
<id>urn:sha1:62f0b399e00f38751834e688677ab49fcccd28fe</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Spelling fixes</title>
<updated>2017-06-27T17:35:49Z</updated>
<author>
<name>Ville Skyttä</name>
<email>ville.skytta@iki.fi</email>
</author>
<published>2017-06-25T10:20:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64127575149e35b409bc2f78962f86507346d604'/>
<id>urn:sha1:64127575149e35b409bc2f78962f86507346d604</id>
<content type='text'>
Signed-off-by: Ville Skyttä &lt;ville.skytta@iki.fi&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
