Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
builtin/gc.c: reduce scope of variables
author
Elia Pinto
<gitter.spiros@gmail.com>
Wed, 29 Jan 2014 16:59:37 +0000
(08:59 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 31 Jan 2014 18:44:05 +0000
(10:44 -0800)
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/gc.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (from parent 1:
bf7e645
)
diff --git
a/builtin/gc.c
b/builtin/gc.c
index 25f2237c08f3b8fbc8f3554f3e22bf7e59e74b1c..5369012d93399fc5a806d382bcfa0138046fa818 100644
(file)
--- a/
builtin/gc.c
+++ b/
builtin/gc.c
@@
-187,13
+187,12
@@
static int need_to_gc(void)
static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
{
static struct lock_file lock;
static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
{
static struct lock_file lock;
- static char locking_host[128];
char my_host[128];
struct strbuf sb = STRBUF_INIT;
struct stat st;
uintmax_t pid;
FILE *fp;
char my_host[128];
struct strbuf sb = STRBUF_INIT;
struct stat st;
uintmax_t pid;
FILE *fp;
- int fd
, should_exit
;
+ int fd;
if (pidfile)
/* already locked */
if (pidfile)
/* already locked */
@@
-205,6
+204,8
@@
static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
fd = hold_lock_file_for_update(&lock, git_path("gc.pid"),
LOCK_DIE_ON_ERROR);
if (!force) {
fd = hold_lock_file_for_update(&lock, git_path("gc.pid"),
LOCK_DIE_ON_ERROR);
if (!force) {
+ static char locking_host[128];
+ int should_exit;
fp = fopen(git_path("gc.pid"), "r");
memset(locking_host, 0, sizeof(locking_host));
should_exit =
fp = fopen(git_path("gc.pid"), "r");
memset(locking_host, 0, sizeof(locking_host));
should_exit =