Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] clone: --dissociate option to mark that reference is only temporary

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:02:43

Johannes Sixt [off-list ref] writes:
Unless you have a secret plan, you can do it even shorter with our
helpers:
Thanks.  No there isn't a secret plan.  It was just me being rusty.
quoted hunk
diff --git a/builtin/clone.c b/builtin/clone.c
index 8649090..81efb07 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -743,14 +743,9 @@ static void write_refspec_config(const char *src_ref_prefix,
 
 static void dissociate_from_references(void)
 {
-	struct child_process cmd;
-
-	memset(&cmd, 0, sizeof(cmd));
-	argv_array_pushl(&cmd.args, "repack", "-a", "-d", NULL);
-	cmd.git_cmd = 1;
-	cmd.out = -1;
-	cmd.no_stdin = 1;
-	if (run_command(&cmd))
+	static const char* argv[] = { "repack", "-a", "-d", NULL };
+
+	if (run_command_v_opt(argv, RUN_GIT_CMD|RUN_COMMAND_NO_STDIN))
 		die(_("cannot repack to clean up"));
 	if (unlink(git_path("objects/info/alternates")) && errno != ENOENT)
 		die_errno(_("cannot unlink temporary alternates file"));
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help