Skip to content

Commit 9ef6eaa

Browse files
mhaggergitster
authored andcommitted
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 <[email protected]>
1 parent 49e8187 commit 9ef6eaa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

refs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,10 +967,10 @@ static int is_refname_available(const char *refname,
967967
* "refs/foo/bar/"). It is a problem iff it contains
968968
* any ref that is not in "skip".
969969
*/
970-
struct ref_entry *entry = dir->entries[pos];
971-
struct ref_dir *dir = get_ref_dir(entry);
972970
struct nonmatching_ref_data data;
971+
struct ref_entry *entry = dir->entries[pos];
973972

973+
dir = get_ref_dir(entry);
974974
data.skip = skip;
975975
sort_ref_dir(dir);
976976
if (!do_for_each_entry_in_dir(dir, 0, nonmatching_ref_fn, &data))

0 commit comments

Comments
 (0)