Re: [PATCH 8/9] transport-helper: add support to delete branches

2013-09-22 Thread Richard Hansen
On 2013-08-29 11:23, Felipe Contreras wrote:
 For remote-helpers that use 'export' to push.
 
 Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
 ---
  t/t5801-remote-helpers.sh |  8 
  transport-helper.c| 11 ++-
  2 files changed, 14 insertions(+), 5 deletions(-)
 
[...]
 diff --git a/transport-helper.c b/transport-helper.c
 index c7135ef..5490796 100644
 --- a/transport-helper.c
 +++ b/transport-helper.c
 @@ -844,18 +844,19 @@ static int push_refs_with_export(struct transport 
 *transport,
   }
   free(private);
  
 - if (ref-deletion)
 - die(remote-helpers do not support ref deletion);
 -

The above deleted lines actually appear twice in transport-helper.c due
to an incorrect merge conflict resolution in
99d9ec090677c925c534001f01cbaf303a31cb82.  The other copy of those lines should
also be deleted:

diff --git a/transport-helper.c b/transport-helper.c
index 859131f..bbf4e7c 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -874,9 +874,6 @@ static int push_refs_with_export(struct transport 
*transport,
char *private;
unsigned char sha1[20];

-   if (ref-deletion)
-   die(remote-helpers do not support ref deletion);
-
private = apply_refspecs(data-refspecs, data-refspec_nr, 
ref-name);
if (private  !get_sha1(private, sha1)) {
strbuf_addf(buf, ^%s, private);
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 8/9] transport-helper: add support to delete branches

2013-09-22 Thread Felipe Contreras
Richard Hansen wrote:
 On 2013-08-29 11:23, Felipe Contreras wrote:
  For remote-helpers that use 'export' to push.
  
  Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
  ---
   t/t5801-remote-helpers.sh |  8 
   transport-helper.c| 11 ++-
   2 files changed, 14 insertions(+), 5 deletions(-)
  
 [...]
  diff --git a/transport-helper.c b/transport-helper.c
  index c7135ef..5490796 100644
  --- a/transport-helper.c
  +++ b/transport-helper.c
  @@ -844,18 +844,19 @@ static int push_refs_with_export(struct transport 
  *transport,
  }
  free(private);
   
  -   if (ref-deletion)
  -   die(remote-helpers do not support ref deletion);
  -
 
 The above deleted lines actually appear twice in transport-helper.c due
 to an incorrect merge conflict resolution in
 99d9ec090677c925c534001f01cbaf303a31cb82.  The other copy of those lines 
 should
 also be deleted:
 
 diff --git a/transport-helper.c b/transport-helper.c
 index 859131f..bbf4e7c 100644
 --- a/transport-helper.c
 +++ b/transport-helper.c
 @@ -874,9 +874,6 @@ static int push_refs_with_export(struct transport 
 *transport,
   char *private;
   unsigned char sha1[20];
 
 - if (ref-deletion)
 - die(remote-helpers do not support ref deletion);
 -
   private = apply_refspecs(data-refspecs, data-refspec_nr, 
 ref-name);
   if (private  !get_sha1(private, sha1)) {
   strbuf_addf(buf, ^%s, private);

Right.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 8/9] transport-helper: add support to delete branches

2013-08-29 Thread Felipe Contreras
For remote-helpers that use 'export' to push.

Signed-off-by: Felipe Contreras felipe.contre...@gmail.com
---
 t/t5801-remote-helpers.sh |  8 
 transport-helper.c| 11 ++-
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
index 8e2dd9f..a66a4e3 100755
--- a/t/t5801-remote-helpers.sh
+++ b/t/t5801-remote-helpers.sh
@@ -94,6 +94,14 @@ test_expect_success 'push new branch with old:new refspec' '
compare_refs local HEAD server refs/heads/new-refspec
 '
 
+test_expect_success 'push delete branch' '
+   (cd local 
+git push origin :new-name
+   ) 
+   test_must_fail git --git-dir=server/.git \
+rev-parse --verify refs/heads/new-name
+'
+
 test_expect_success 'cloning without refspec' '
GIT_REMOTE_TESTGIT_REFSPEC= \
git clone testgit::${PWD}/server local2 2error 
diff --git a/transport-helper.c b/transport-helper.c
index c7135ef..5490796 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -844,18 +844,19 @@ static int push_refs_with_export(struct transport 
*transport,
}
free(private);
 
-   if (ref-deletion)
-   die(remote-helpers do not support ref deletion);
-
if (ref-peer_ref) {
if (strcmp(ref-name, ref-peer_ref-name)) {
struct strbuf buf = STRBUF_INIT;
-   strbuf_addf(buf, %s:%s, ref-peer_ref-name, 
ref-name);
+   if (!ref-deletion)
+   strbuf_addf(buf, %s:%s, 
ref-peer_ref-name, ref-name);
+   else
+   strbuf_addf(buf, :%s, ref-name);
string_list_append(revlist_args, --refspec);
string_list_append(revlist_args, buf.buf);
strbuf_release(buf);
}
-   string_list_append(revlist_args, ref-peer_ref-name);
+   if (!ref-deletion)
+   string_list_append(revlist_args, 
ref-peer_ref-name);
}
}
 
-- 
1.8.4-fc

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html