From: Johannes Schindelin Date: Mon, 18 Feb 2008 13:29:55 GMT Subject: Re: [PATCH] branch: optionally setup branch.*.merge from upstream local branches Message-ID: In-Reply-To: <1203341084-18543-1-git-send-email-jaysoffian@gmail.com> Hi, sorry, I overlooked that earlier: On Mon, 18 Feb 2008, Jay Soffian wrote: > diff --git a/branch.c b/branch.c > index 1fc8788..24e98dd 100644 > --- a/branch.c > +++ b/branch.c > @@ -130,7 +130,15 @@ void create_branch(const char *head, > automatically merges from there. So far, this is only done for > remotes registered via .git/config. */ > if (real_ref && track) > - setup_tracking(name, real_ref); > + if (setup_tracking(name, real_ref) == 1 && track == BRANCH_TRACK_ALWAYS) { This line is too long. > + char key[1024]; > + sprintf(key, "branch.%s.remote", name); To stay safe, you should use snprintf() and test the return value. > + git_config_set(key, "."); > + sprintf(key, "branch.%s.merge", name); Same here. Thanks, Dscho