FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix for untracked_files no longer detected #138 by maxyz · Pull Request #159 · gitpython-developers/GitPython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
29 changes: 14 additions & 15 deletions git/db/cmd/base.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -662,26 +662,25 @@ def is_dirty(self, index=True, working_tree=True, untracked_files=False):
return True
# END untracked files
return False

@property
def untracked_files(self):
# make sure we get all files, no only untracked directores
proc = self.git.status(untracked_files=True, as_process=True)
stream = iter(proc.stdout)
proc = self.git.status(porcelain=True,
untracked_files=True,
as_process=True)
# Untracked files preffix in porcelain mode
prefix = "?? "

untracked_files = list()
for line in stream:
if not line.startswith("# Untracked files:"):
for line in proc.stdout:
if not line.startswith(prefix):
continue
# skip two lines
stream.next()
stream.next()

for untracked_info in stream:
if not untracked_info.startswith("#\t"):
break
untracked_files.append(untracked_info.replace("#\t", "").rstrip())
# END for each utracked info line
# END for each line
filename = line[len(prefix):].rstrip('\n')
# Special characters are escaped
if filename[0] == filename[-1] == '"':
filename = filename[1:-1].decode('string_escape')
untracked_files.append(filename)
return untracked_files

def blame(self, rev, file):
Expand Down

Back | FazBrowse Home | New Git URL