← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/turnip:fix-set-symbolic-ref-notify into turnip:master

 

Colin Watson has proposed merging ~cjwatson/turnip:fix-set-symbolic-ref-notify into turnip:master.

Commit message:
Fix set-symbolic-ref notify arguments

We should be passing the raw translated path, not the path prefixed with
the repository store path.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/turnip/+git/turnip/+merge/310639
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/turnip:fix-set-symbolic-ref-notify into turnip:master.
diff --git a/turnip/pack/git.py b/turnip/pack/git.py
index 93bc91b..1f08bcf 100644
--- a/turnip/pack/git.py
+++ b/turnip/pack/git.py
@@ -490,7 +490,8 @@ class PackBackendProtocol(PackServerProtocol):
         if self.command == b'turnip-set-symbolic-ref':
             if reason.check(error.ProcessDone):
                 try:
-                    yield self.factory.hookrpc_handler.notify(self.path)
+                    yield self.factory.hookrpc_handler.notify(
+                        self.raw_pathname)
                     self.sendPacket(b'ACK %s\n' % self.symbolic_ref_name)
                 except Exception as e:
                     message = str(e)
diff --git a/turnip/pack/tests/test_functional.py b/turnip/pack/tests/test_functional.py
index e6dbd20..d5cf85e 100644
--- a/turnip/pack/tests/test_functional.py
+++ b/turnip/pack/tests/test_functional.py
@@ -526,6 +526,8 @@ class TestSmartHTTPFrontendFunctional(FrontendFunctionalTestMixin, TestCase):
         self.assertEqual((b'ACK HEAD\n', ''), helpers.decode_packet(body))
         head_target = yield self.get_symbolic_ref(repo, b'HEAD')
         self.assertEqual(b'refs/heads/new-head', head_target)
+        self.assertEqual(
+            [self.internal_name], self.virtinfo.push_notifications)
 
     @defer.inlineCallbacks
     def test_turnip_set_symbolic_ref_error(self):