Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ogr3 committed Jul 21, 2016
2 parents a2ec3c8 + e6708c3 commit 652de58
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
4 changes: 2 additions & 2 deletions gitprompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ function createPrivateIndex {
__GIT_INDEX_FILE="$GIT_INDEX_FILE"
fi
__GIT_INDEX_PRIVATE="/tmp/git-index-private$$"
cp "$__GIT_INDEX_FILE" "$__GIT_INDEX_PRIVATE" 2>/dev/null
command cp "$__GIT_INDEX_FILE" "$__GIT_INDEX_PRIVATE" 2>/dev/null
echo "$__GIT_INDEX_PRIVATE"
}

Expand Down Expand Up @@ -547,7 +547,7 @@ function updatePrompt() {
fi

PS1="${NEW_PROMPT//_LAST_COMMAND_INDICATOR_/${LAST_COMMAND_INDICATOR}${ResetColor}}"
rm "$GIT_INDEX_PRIVATE" 2>/dev/null
command rm "$GIT_INDEX_PRIVATE" 2>/dev/null
}

# Helper function that returns virtual env information to be set in prompt
Expand Down
32 changes: 23 additions & 9 deletions gitstatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@

try:
Print = eval("print") # python 3.0 case
except SyntaxError:
python_version = 3
to_str = str
except SyntaxError as e:
python_version = 2
to_str = unicode
D = dict()
try:
exec ("from __future__ import print_function\np=print", D)
Expand Down Expand Up @@ -126,14 +130,24 @@ def get_stash():
if remote == "":
remote = '.'

if python_version == 2:
remote = remote.decode('utf-8')

out = '\n'.join([
branch,
remote.decode('utf-8'),
str(len(staged)),
str(len(conflicts)),
str(len(changed)),
str(len(untracked)),
str(stashed),
str(clean)
remote,
to_str(len(staged)),
to_str(len(conflicts)),
to_str(len(changed)),
to_str(len(untracked)),
to_str(stashed),
to_str(clean),
to_str(python_version),
])
Print(out)


if python_version == 2:
Print(out.encode('utf-8'))
else:
Print(out)

0 comments on commit 652de58

Please sign in to comment.