Ver código fonte

Add capability_symref.

Jelmer Vernooij 7 anos atrás
pai
commit
63469b09d4
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      dulwich/protocol.py

+ 5 - 0
dulwich/protocol.py

@@ -61,6 +61,7 @@ CAPABILITY_SHALLOW = b'shallow'
 CAPABILITY_SIDE_BAND_64K = b'side-band-64k'
 CAPABILITY_THIN_PACK = b'thin-pack'
 CAPABILITY_AGENT = b'agent'
+CAPABILITY_SYMREF = b'symref'
 
 # Magic ref that is used to attach capabilities to when
 # there are no refs. Should always be ste to ZERO_SHA.
@@ -75,6 +76,10 @@ def capability_agent():
     return CAPABILITY_AGENT + b'=' + agent_string()
 
 
+def capability_symref(from_ref, to_ref):
+    return CAPABILITY_SYMREF + b'=' + from_ref + b':' + to_ref
+
+
 COMMAND_DEEPEN = b'deepen'
 COMMAND_SHALLOW = b'shallow'
 COMMAND_UNSHALLOW = b'unshallow'