git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Miller <jackerran@gmail.com>
To: git@vger.kernel.org
Cc: Tom Miller <jackerran@gmail.com>
Subject: [PATCH/WIP] Repair DF conflicts during fetch.
Date: Fri, 29 Nov 2013 11:57:38 -0600	[thread overview]
Message-ID: <1385747858-29343-2-git-send-email-jackerran@gmail.com> (raw)
In-Reply-To: <1385747858-29343-1-git-send-email-jackerran@gmail.com>

When a DF conflict occurs during a fetch, --prune should be able to fix
it. When fetching with --prune, the fetching process happens before
pruning causing the DF conflict to persist and report an error. This
patch prunes before fetching, thus correcting DF conflicts during a
fetch.

Signed-off-by: Tom Miller <jackerran@gmail.com>
---
 builtin/fetch.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/builtin/fetch.c b/builtin/fetch.c
index bd7a101..f7959d0 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -824,11 +824,6 @@ static int do_fetch(struct transport *transport,
 
 	if (tags == TAGS_DEFAULT && autotags)
 		transport_set_option(transport, TRANS_OPT_FOLLOWTAGS, "1");
-	if (fetch_refs(transport, ref_map)) {
-		free_refs(ref_map);
-		retcode = 1;
-		goto cleanup;
-	}
 	if (prune) {
 		/*
 		 * If --tags was specified, pretend that the user gave us
@@ -857,6 +852,11 @@ static int do_fetch(struct transport *transport,
 			prune_refs(transport->remote->fetch, transport->remote->fetch_refspec_nr, ref_map);
 		}
 	}
+	if (fetch_refs(transport, ref_map)) {
+		free_refs(ref_map);
+		retcode = 1;
+		goto cleanup;
+	}
 	free_refs(ref_map);
 
 	/* if neither --no-tags nor --tags was specified, do automated tag
-- 
1.8.5.rc3.dirty

  reply	other threads:[~2013-11-29 17:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-29 17:57 [PATCH/WIP] Repair DF conflicts during fetch Tom Miller
2013-11-29 17:57 ` Tom Miller [this message]
2013-11-29 19:07   ` Thomas Rast
2013-12-01 15:03     ` Thomas Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1385747858-29343-2-git-send-email-jackerran@gmail.com \
    --to=jackerran@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).