From: Catalin Marinas Date: Thu, 21 Aug 2008 22:12:16 +0000 (+0100) Subject: Remove the duplicate utils.strip_leading function X-Git-Tag: v0.15-rc1~166 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/56555887d1e214258858045fdd348337972850e7 Remove the duplicate utils.strip_leading function This function is a duplicate of utils.strip_prefix. Signed-off-by: Catalin Marinas --- diff --git a/stgit/lib/git.py b/stgit/lib/git.py index c9d0119..2386e27 100644 --- a/stgit/lib/git.py +++ b/stgit/lib/git.py @@ -534,7 +534,7 @@ class Repository(RunWithEnv): @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 diff --git a/stgit/utils.py b/stgit/utils.py index 2983ea8..864975d 100644 --- a/stgit/utils.py +++ b/stgit/utils.py @@ -379,12 +379,6 @@ STGIT_COMMAND_ERROR = 2 # seems to be a command that failed 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."""