Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fg-errbot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRC Team
Errbot Development
fg-errbot
Commits
25cd005c
Commit
25cd005c
authored
8 years ago
by
Bruce Cowan
Browse files
Options
Downloads
Patches
Plain Diff
[Git] improve string parsing
parent
245497dc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bot/plugins/Git/git.py
+5
-3
5 additions, 3 deletions
bot/plugins/Git/git.py
with
5 additions
and
3 deletions
bot/plugins/Git/git.py
+
5
−
3
View file @
25cd005c
...
...
@@ -15,9 +15,11 @@ class Git(BotPlugin):
try
:
cp
=
subprocess
.
run
([
"
git
"
,
"
describe
"
],
stdout
=
subprocess
.
PIPE
,
check
=
True
)
version_s
=
cp
.
stdout
.
decode
(
sys
.
stdout
.
encoding
).
rstrip
()
version_s
=
str
(
cp
.
stdout
,
sys
.
stdout
.
encoding
).
rstrip
()
return
"
Git version {}
"
.
format
(
version_s
)
except
FileNotFoundError
:
return
"
Git is not installed
"
return
"
**Error**:
Git is not installed
"
except
subprocess
.
CalledProcessError
:
return
"
No git repository found
"
return
"
**Error**: No git repository found
"
except
UnicodeError
:
return
"
**Error**: Couldn
'
t convert to string
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment