pick-ui: make .pick_status.json path relative to the git root instead of the script
This allows the script to be called from another git worktree for instance, which I need for my workflow :) Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4649>
This commit is contained in:

committed by
Marge Bot

parent
26a26a3584
commit
32451a15ec
@@ -25,6 +25,7 @@ import enum
|
|||||||
import json
|
import json
|
||||||
import pathlib
|
import pathlib
|
||||||
import re
|
import re
|
||||||
|
import subprocess
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
@@ -55,7 +56,9 @@ SEM = asyncio.Semaphore(50)
|
|||||||
|
|
||||||
COMMIT_LOCK = asyncio.Lock()
|
COMMIT_LOCK = asyncio.Lock()
|
||||||
|
|
||||||
pick_status_json = pathlib.Path(__file__).parent.parent.parent / '.pick_status.json'
|
git_toplevel = subprocess.check_output(['git', 'rev-parse', '--show-toplevel'],
|
||||||
|
stderr=subprocess.DEVNULL).decode("ascii").strip()
|
||||||
|
pick_status_json = pathlib.Path(git_toplevel) / '.pick_status.json'
|
||||||
|
|
||||||
|
|
||||||
class PickUIException(Exception):
|
class PickUIException(Exception):
|
||||||
|
Reference in New Issue
Block a user