Title: [260365] trunk/Tools
Revision
260365
Author
dp...@igalia.com
Date
2020-04-20 08:24:17 -0700 (Mon, 20 Apr 2020)

Log Message

[Flatpak SDK] Prevent exception when calling git in a non-git repository
https://bugs.webkit.org/show_bug.cgi?id=210737

Reviewed by Philippe Normand.

* flatpak/flatpakutils.py:
(WebkitFlatpak.is_branch_build): Return false if command executes in a
non-git repository (i.e SVN).

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (260364 => 260365)


--- trunk/Tools/ChangeLog	2020-04-20 14:37:47 UTC (rev 260364)
+++ trunk/Tools/ChangeLog	2020-04-20 15:24:17 UTC (rev 260365)
@@ -1,3 +1,14 @@
+2020-04-20  Diego Pino Garcia  <dp...@igalia.com>
+
+        [Flatpak SDK] Prevent exception when calling git in a non-git repository
+        https://bugs.webkit.org/show_bug.cgi?id=210737
+
+        Reviewed by Philippe Normand.
+
+        * flatpak/flatpakutils.py:
+        (WebkitFlatpak.is_branch_build): Return false if command executes in a
+        non-git repository (i.e SVN).
+
 2020-04-20  Philippe Normand  <pnorm...@igalia.com>
 
         [Flatpak SDK] Drive-by fixes

Modified: trunk/Tools/flatpak/flatpakutils.py (260364 => 260365)


--- trunk/Tools/flatpak/flatpakutils.py	2020-04-20 14:37:47 UTC (rev 260364)
+++ trunk/Tools/flatpak/flatpakutils.py	2020-04-20 15:24:17 UTC (rev 260365)
@@ -558,7 +558,11 @@
         return [os.path.join(gst_dir, 'gst-env.py'), '--builddir', gst_builddir, '--srcdir', gst_dir]
 
     def is_branch_build(self):
-        git_branch_name = subprocess.check_output(("git", "rev-parse", "--abbrev-ref", "HEAD")).decode("utf-8").strip()
+        try:
+            rev_parse = subprocess.check_output(("git", "rev-parse", "--abbrev-ref", "HEAD"))
+        except subprocess.CalledProcessError:
+            return False
+        git_branch_name = rev_parse.decode("utf-8").strip()
         for option_name in ("branch.%s.webKitBranchBuild" % git_branch_name,
                             "webKitBranchBuild"):
             try:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to