Package: stgit / 0.18-1

Avoid-the-git-error-messages-when-running-stg-outside-of-.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Maximiliano Curia <maxy@gnuservers.com.ar>
Date: Sat, 2 Sep 2017 14:08:42 +0200
Subject: Avoid the git error messages when running stg outside of a git tree

---
 stgit/version.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/stgit/version.py b/stgit/version.py
index 94f89a8..7cac6f6 100644
--- a/stgit/version.py
+++ b/stgit/version.py
@@ -9,14 +9,14 @@ def git_describe_version():
     path = sys.path[0]
     try:
         v = run.Run('git', 'describe', '--tags', '--abbrev=4'
-                    ).cwd(path).output_one_line()
+                    ).cwd(path).discard_stderr().output_one_line()
     except run.RunException, e:
         raise VersionUnavailable(str(e))
     if not re.match(r'^v[0-9]', v):
         raise VersionUnavailable('%s: bad version' % v)
     try:
         dirty = run.Run('git', 'diff-index', '--name-only', 'HEAD'
-                        ).cwd(path).raw_output()
+                        ).cwd(path).discard_stderr().raw_output()
     except run.RunException, e:
         raise VersionUnavailable(str(e))
     if dirty: