safe_create_leading_directories(): reduce scope of local variable

This makes it more obvious that values of "st" don't persist across
loop iterations.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Michael Haggerty 2014-01-06 14:45:20 +01:00 committed by Junio C Hamano
parent 53a3972171
commit f05023324c

View File

@ -108,9 +108,10 @@ int mkdir_in_gitdir(const char *path)
int safe_create_leading_directories(char *path)
{
char *pos = path + offset_1st_component(path);
struct stat st;
while (pos) {
struct stat st;
pos = strchr(pos, '/');
if (!pos)
break;