summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorLibravatar René Scharfe <l.s.r@web.de>2017-09-23 11:44:57 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-09-24 10:18:18 +0900
commite691b027b60034ed3362fc4d6065b6be85bf234b (patch)
tree70bd0398eea23aa1848f9e8265a8e4e005f85432 /refs
parentrefs: make sha1 output parameter of refs_resolve_ref_unsafe() optional (diff)
downloadtgif-e691b027b60034ed3362fc4d6065b6be85bf234b.tar.xz
refs: pass NULL to refs_resolve_ref_unsafe() if hash is not needed
This allows us to get rid of two write-only variables, one of them being a SHA1 buffer. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 32663a999e..a3134d23ab 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1676,13 +1676,12 @@ static int commit_ref_update(struct files_ref_store *refs,
* check with HEAD only which should cover 99% of all usage
* scenarios (even 100% of the default ones).
*/
- struct object_id head_oid;
int head_flag;
const char *head_ref;
head_ref = refs_resolve_ref_unsafe(&refs->base, "HEAD",
RESOLVE_REF_READING,
- head_oid.hash, &head_flag);
+ NULL, &head_flag);
if (head_ref && (head_flag & REF_ISSYMREF) &&
!strcmp(head_ref, lock->ref_name)) {
struct strbuf log_err = STRBUF_INIT;