Commit 2edc30c6 authored by Kai Willadsen's avatar Kai Willadsen

Support unversioned files in git (closes bgo#662084)

Neither git diff-index nor name-status give us information about
untracked files within git. This commit adds an additional ls-files
call to obtain a list of untracked/unversioned files.
parent 1af1740e
......@@ -46,6 +46,7 @@ class Vc(_vc.CachedVc):
"T": _vc.STATE_MODIFIED, # Type-changed
"U": _vc.STATE_CONFLICT, # Unmerged
"I": _vc.STATE_IGNORED, # Ignored (made-up status letter)
"?": _vc.STATE_NONE, # Unversioned
}
def check_repo_root(self, location):
......@@ -98,10 +99,16 @@ class Vc(_vc.CachedVc):
"-0", path], cwd=self.location)
entries += (proc.read().split("\n")[:-1])
# Identify ignored files
proc = _vc.popen([self.CMD, "ls-files", "--others", \
"--ignored", "--exclude-standard", path], cwd=self.location)
entries += ("I\t%s" % f for f in proc.read().split("\n")[:-1])
# Identify unversioned files
proc = _vc.popen([self.CMD, "ls-files", "--others", \
"--exclude-standard", path], cwd=self.location)
entries += ("?\t%s" % f for f in proc.read().split("\n")[:-1])
# An unmerged file or a file that has been modified, added to
# git's index, then modified again would result in the file
# showing up in both the output of "diff-files" and
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment