Skip to content

Commit

Permalink
is_refname_available(): avoid shadowing "dir" variable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed May 11, 2015
1 parent 49e8187 commit 9ef6eaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 9ef6eaa

Please sign in to comment.