summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2015-05-11 15:25:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-05-11 18:50:17 (GMT)
commit9ef6eaa287b12ff9469c7775507f107b86f9a8c8 (patch)
treeb7b92c21dfb3306284bc550b418d4ecfb12beede /refs.c
parent49e818762aaf08791504d4de2076027e7d275844 (diff)
downloadgit-9ef6eaa287b12ff9469c7775507f107b86f9a8c8.zip
git-9ef6eaa287b12ff9469c7775507f107b86f9a8c8.tar.gz
git-9ef6eaa287b12ff9469c7775507f107b86f9a8c8.tar.bz2
is_refname_available(): avoid shadowing "dir" variable
The function had a "dir" parameter that was shadowed by a local "dir" variable within a code block. Use the former in place of the latter. (This is consistent with "dir"'s use elsewhere in the function.) Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/refs.c b/refs.c
index 776bbce..9d87e84 100644
--- a/refs.c
+++ b/refs.c
@@ -967,10 +967,10 @@ static int is_refname_available(const char *refname,
* "refs/foo/bar/"). It is a problem iff it contains
* any ref that is not in "skip".
*/
- struct ref_entry *entry = dir->entries[pos];
- struct ref_dir *dir = get_ref_dir(entry);
struct nonmatching_ref_data data;
+ struct ref_entry *entry = dir->entries[pos];
+ dir = get_ref_dir(entry);
data.skip = skip;
sort_ref_dir(dir);
if (!do_for_each_entry_in_dir(dir, 0, nonmatching_ref_fn, &data))