def update(self):
        self.clear()
        logging.debug('getting status')
        for line in os.popen('git status').readlines():
            line = line.strip()
            if line.startswith('#\t'):
                try:
                    status, file = [l.strip() for l in line[2:].split(':')]
                    if self.status.has_key(file):
                        self.status[status].append(file)
                    else:
                        self.status[status] = [file]
                except __HOLE__:
                    if self.status.has_key('untracked'):
                        self.status['untracked'].append( line[2:].strip() )
                    else:
                        self.status['untracked'] = [ line[2:].strip() ]
        logging.debug('current status: %r' %self.status)
        return self.status
dataset/ETHPy150Open semk/GitFS/gitfs.py/GitStatus.update