浏览代码

Special case 'refs/stash' as a valid ref.

Jelmer Vernooij 13 年之前
父节点
当前提交
e0e795f3e9
共有 3 个文件被更改,包括 4 次插入1 次删除
  1. 2 0
      NEWS
  2. 1 1
      dulwich/repo.py
  3. 1 0
      dulwich/tests/test_repository.py

+ 2 - 0
NEWS

@@ -25,6 +25,8 @@
 
   * Fix compilation with older versions of MSVC.  (Martin gz)
 
+  * Special case 'refs/stash' as a valid ref. (Jelmer Vernooij, #695577)
+
 0.8.0	2011-08-07
 
  FEATURES

+ 1 - 1
dulwich/repo.py

@@ -213,7 +213,7 @@ class RefsContainer(object):
         :param name: The name of the reference.
         :raises KeyError: if a refname is not HEAD or is otherwise not valid.
         """
-        if name == 'HEAD':
+        if name in ('HEAD', 'refs/stash'):
             return
         if not name.startswith('refs/') or not check_ref_format(name[5:]):
             raise RefFormatError(name)

+ 1 - 0
dulwich/tests/test_repository.py

@@ -674,6 +674,7 @@ class RefsContainerTests(object):
 
     def test_check_refname(self):
         self._refs._check_refname('HEAD')
+        self._refs._check_refname('refs/stash')
         self._refs._check_refname('refs/heads/foo')
 
         self.assertRaises(errors.RefFormatError, self._refs._check_refname,