Re: [PATCH 12/16] builtin-fetch--tool: extend "native-store" for use in cloning
From: Alex Riesen <hidden>
Date: 2016-06-15 22:43:11
Subsystem:
the rest · Maintainer:
Linus Torvalds
skimo@liacs.nl, Fri, May 18, 2007 21:25:01 +0200:
quoted hunk ↗ jump to hunk
@@ -261,7 +287,8 @@ static int fetch_native_store(FILE *fp, const char *remote, const char *remote_nick, const char *refs, - int verbose, int force) + int verbose, int force, + int all, int use_separate_remote) { char buffer[1024]; int err = 0;@@ -294,8 +321,12 @@ static int fetch_native_store(FILE *fp, continue; } - local_name = find_local_name(cp, refs, - &single_force, ¬_for_merge); + if (all) + local_name = construct_local_name(cp, remote_nick, + use_separate_remote); + else + local_name = find_local_name(cp, refs, + &single_force, ¬_for_merge);
This code produces warning about possible uninitialized used of single_force and not_for_merge. I used the patch below, but didn't look into what the "all" does. --- builtin-fetch--tool.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
index 12adb38..ebb49d9 100644
--- a/builtin-fetch--tool.c
+++ b/builtin-fetch--tool.c@@ -273,7 +273,7 @@ static int fetch_native_store(FILE *fp, int len; char *cp; char *local_name; - int single_force, not_for_merge; + int single_force = force, not_for_merge = 0; for (cp = buffer; *cp && !isspace(*cp); cp++) ;
@@ -301,7 +301,7 @@ static int fetch_native_store(FILE *fp, err |= append_fetch_head(fp, buffer, remote, cp, remote_nick, local_name, not_for_merge, - verbose, force || single_force); + verbose, single_force); } return err; }
--
1.5.2.rc3.83.gbbb0