aboutsummaryrefslogtreecommitdiff
blob: 5d25ec5ab14c87e48147be5fbb8583ae2f57a7a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""
Filesystem utils
"""
import os

def strip_prefix(string, prefix):
    """Returns a string, stripped from its prefix"""
    if string.startswith(prefix):
        return string[len(prefix):]
    else:
        return string

def remove_file(repo, dst):
    """Removes a file from a repository"""
    repo.index.remove(dst)
    os.remove(dst)