Code

remote-helpers: return successfully if everything up-to-date
authorClemens Buchacher <drizzd@aon.at>
Sat, 31 Oct 2009 00:47:31 +0000 (17:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 31 Oct 2009 02:20:54 +0000 (19:20 -0700)
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5540-http-push.sh
transport-helper.c

index 09edd2387bd4fb603f8eb2d2611be950ced322d2..2ece6612e13a8ae563cd992f083e1b0be4de34f5 100755 (executable)
@@ -58,7 +58,7 @@ test_expect_success 'push to remote repository with packed refs' '
         test $HEAD = $(git rev-parse --verify HEAD))
 '
 
-test_expect_failure 'push already up-to-date' '
+test_expect_success 'push already up-to-date' '
        git push
 '
 
index 16c6641f03e36893f95daf4609d1d85e69ab3088..5078c7100f16e9d7ac08aad05e3797ad5b6626bc 100644 (file)
@@ -263,6 +263,8 @@ static int push_refs(struct transport *transport,
                strbuf_addstr(&buf, ref->name);
                strbuf_addch(&buf, '\n');
        }
+       if (buf.len == 0)
+               return 0;
 
        transport->verbose = flags & TRANSPORT_PUSH_VERBOSE ? 1 : 0;
        standard_options(transport);