[PATCH] builtin-remote: resurrect forced updates to tracked branches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



During the rewrite of git-remote as a builtin, the ability to force
updating the tracked branches (i.e. forcing non-fast-forwards) was
lost.

This patch fixes that.

Noticed by Mike Galbraith, analyzed by Jeff King.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@xxxxxx>

---

	On Tue, 22 Apr 2008, Jeff King wrote:

	> On Tue, Apr 22, 2008 at 02:03:43PM +0100, Johannes Schindelin wrote:
	> 
	> > Oh, that's right: only "git remote prune" will delete stale refs only.
	> > 
	> > But my other point about possibly interfering with local 
	> > branches still holds true.
	> 
	> In that case, I think that the '+' should come only without 
	> --mirror, and my complaint is then that "--mirror" is a horrible name 
	> for that option. Though when I saw it, I really expected it to do 
	> something about the _push_ line, since that is the only other place we 
	> have a --mirror option. It would make sense to me for it to set up 
	> remote.$x.mirror (which is newly added in next). But then, git-remote 
	> doesn't seem to be geared towards pushing at all.

	I still think that the --mirror option has merit, but I missed 
	that your patch did fix the behviour _without_ --mirror.

	This is my attempt.

 builtin-remote.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-remote.c b/builtin-remote.c
index d4f2132..117ff60 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -114,7 +114,7 @@ static int add(int argc, const char **argv)
 			strbuf_addf(&buf2, "refs/%s:refs/%s",
 					item->path, item->path);
 		else
-			strbuf_addf(&buf2, "refs/heads/%s:refs/remotes/%s/%s",
+			strbuf_addf(&buf2, "+refs/heads/%s:refs/remotes/%s/%s",
 					item->path, name, item->path);
 		if (git_config_set_multivar(buf.buf, buf2.buf, "^$", 0))
 			return 1;
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux