<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_vcs(self, fname, index):
 """Update vcs status."""

        fpath = os.path.dirname(fname)
        branches, branch, files_modified = get_git_refs(fpath)
        text = branch if branch else ''

        if len(files_modified):
            text = text + ' [{}]'.format(len(files_modified))

        self.setVisible(bool(branch))
        self.set_value(text)