This function is a duplicate of utils.strip_prefix.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
@property
def current_branch_name(self):
"""Return the name of the current branch."""
@property
def current_branch_name(self):
"""Return the name of the current branch."""
- return utils.strip_leading('refs/heads/', self.head_ref)
+ return utils.strip_prefix('refs/heads/', self.head_ref)
@property
def default_index(self):
"""An L{Index} object representing the default index file for the
@property
def default_index(self):
"""An L{Index} object representing the default index file for the
STGIT_CONFLICT = 3 # merge conflict, otherwise OK
STGIT_BUG_ERROR = 4 # a bug in StGit
STGIT_CONFLICT = 3 # merge conflict, otherwise OK
STGIT_BUG_ERROR = 4 # a bug in StGit
-def strip_leading(prefix, s):
- """Strip leading prefix from a string. Blow up if the prefix isn't
- there."""
- assert s.startswith(prefix)
- return s[len(prefix):]
-
def add_dict(d1, d2):
"""Return a new dict with the contents of both d1 and d2. In case of
conflicting mappings, d2 takes precedence."""
def add_dict(d1, d2):
"""Return a new dict with the contents of both d1 and d2. In case of
conflicting mappings, d2 takes precedence."""