builtin/gc.c: reduce scope of variables
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elia Pinto committed
Jan 29, 2014 at 08:59 UTC
4f1c0b21e9045ff12e1880b5724a032031716a24
1 file changed
+3
-2
builtin/gc.c
+3
-2
@@ -187,13 +187,12 @@ static int need_to_gc(void)
187
static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
188
{
189
static struct lock_file lock;
190
- static char locking_host[128];
190
char my_host[128];
191
struct strbuf sb = STRBUF_INIT;
192
struct stat st;
193
uintmax_t pid;
194
FILE *fp;
196
- int fd, should_exit;
195
+ int fd;
196
197
if (pidfile)
198
/* already locked */
@@ -205,6 +204,8 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
204
fd = hold_lock_file_for_update(&lock, git_path("gc.pid"),
205
LOCK_DIE_ON_ERROR);
206
if (!force) {
207
+ static char locking_host[128];
208
+ int should_exit;
209
fp = fopen(git_path("gc.pid"), "r");
210
memset(locking_host, 0, sizeof(locking_host));
211
should_exit =