git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 4/6] push: remove dead code in setup_push_upstream()

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 19, 2013, 20:01 UTC
Message-ID
<7vy5a5yino.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1371640304-26019-5-git-send-email-artagnon@gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
> Now that simple has been decoupled from upstream in setup_push_simple(),
> remove the dead code in setup_push_upstream().
Good.
Show 37 quoted lines
>
> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
> ---
>  builtin/push.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/builtin/push.c b/builtin/push.c
> index d8d27d9..783bacf 100644
> --- a/builtin/push.c
> +++ b/builtin/push.c
> @@ -139,7 +139,7 @@ end:
>  	add_refspec(branch->name);
>  }
>  
> -static void setup_push_upstream(struct remote *remote, int simple)
> +static void setup_push_upstream(struct remote *remote)
>  {
>  	struct strbuf refspec = STRBUF_INIT;
>  	struct branch *branch = branch_get(NULL);
> @@ -161,8 +161,6 @@ static void setup_push_upstream(struct remote *remote, int simple)
>  		      "your current branch '%s', without telling me what to push\n"
>  		      "to update which remote branch."),
>  		    remote->name, branch->name);
> -	if (simple && strcmp(branch->refname, branch->merge[0]->src))
> -		die_push_simple(branch, remote);
>  
>  	strbuf_addf(&refspec, "%s:%s", branch->name, branch->merge[0]->src);
>  	add_refspec(refspec.buf);
> @@ -211,7 +209,7 @@ static void setup_default_push_refspecs(struct remote *remote)
>  		break;
>  
>  	case PUSH_DEFAULT_UPSTREAM:
> -		setup_push_upstream(remote, 0);
> +		setup_push_upstream(remote);
>  		break;
>  
>  	case PUSH_DEFAULT_CURRENT:
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 20 of 24 in “push.default in the triangular world”
  1. 0/6 push.default in the triangular worldRamkumar Ramachandra, Jun 19, 2013
  2. 1/6 t/t5528-push-default: remove redundant test_config linesRamkumar Ramachandra, Jun 19, 2013
  3. Junio C HamanoJun 19, 2013
  4. 2/6 config doc: rewrite push.default sectionRamkumar Ramachandra, Jun 19, 2013
  5. Junio C HamanoJun 19, 2013
  6. Junio C HamanoJun 20, 2013
  7. Johan HerlandJun 20, 2013
  8. 3/6 push: change `simple` to accommodate triangular workflowsRamkumar Ramachandra, Jun 19, 2013
  9. Junio C HamanoJun 19, 2013
  10. Junio C HamanoJun 20, 2013
  11. Ramkumar RamachandraJun 20, 2013
  12. Junio C HamanoJun 20, 2013
  13. Philip OakleyJun 20, 2013
  14. Junio C HamanoJun 20, 2013
  15. Ramkumar RamachandraJun 20, 2013
  16. Junio C HamanoJun 20, 2013
  17. Junio C HamanoJun 20, 2013
  18. Junio C HamanoJun 20, 2013
  19. 4/6 push: remove dead code in setup_push_upstream()Ramkumar Ramachandra, Jun 19, 2013
  20. Junio C HamanoJun 19, 2013
  21. 5/6 t/t5528-push-default: generalize test_push_*Ramkumar Ramachandra, Jun 19, 2013
  22. Junio C HamanoJun 19, 2013
  23. 6/6 t/t5528-push-default: test pushdefault workflowsRamkumar Ramachandra, Jun 19, 2013
  24. Junio C HamanoJun 19, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.