diff options
author | René Scharfe <l.s.r@web.de> | 2017-09-23 11:44:57 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-24 10:18:18 +0900 |
commit | e691b027b60034ed3362fc4d6065b6be85bf234b (patch) | |
tree | 70bd0398eea23aa1848f9e8265a8e4e005f85432 /worktree.c | |
parent | 54fad6614fc6b61ee6eb4a5b3daa7a2239019b49 (diff) | |
download | git-e691b027b60034ed3362fc4d6065b6be85bf234b.tar.gz |
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 'worktree.c')
-rw-r--r-- | worktree.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/worktree.c b/worktree.c index 8aaeea0377..70015629dc 100644 --- a/worktree.c +++ b/worktree.c @@ -307,7 +307,6 @@ const struct worktree *find_shared_symref(const char *symref, for (i = 0; worktrees[i]; i++) { struct worktree *wt = worktrees[i]; const char *symref_target; - unsigned char sha1[20]; struct ref_store *refs; int flags; @@ -327,7 +326,7 @@ const struct worktree *find_shared_symref(const char *symref, refs = get_worktree_ref_store(wt); symref_target = refs_resolve_ref_unsafe(refs, symref, 0, - sha1, &flags); + NULL, &flags); if ((flags & REF_ISSYMREF) && !strcmp(symref_target, target)) { existing = wt; break; |