Skip to content

Commit 117eb0b

Browse files
committed
lib/setup.sh: show jj status output on errors
Signed-off-by: Tim Janik <timj@gnu.org>
1 parent ad00d37 commit 117eb0b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/setup.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,16 @@ export -f jjfzf_config_quote
111111
jjfzf_status()
112112
(
113113
CID=$(jj --no-pager --ignore-working-copy log --no-graph -r @ -T commit_id)
114-
( set -x
115-
jj --no-pager status $JJFZF_COLOR
116-
) > $JJFZF_TEMPD/status 2>&1
117-
test $(jj --no-pager --ignore-working-copy log --no-graph -r @ -T commit_id) == "$CID" ||
114+
if ( set -x && jj --no-pager status $JJFZF_COLOR ) > $JJFZF_TEMPD/status 2>&1 ; then
115+
test $(jj --no-pager --ignore-working-copy log --no-graph -r @ -T commit_id) == "$CID" ||
116+
cat $JJFZF_TEMPD/status >&2
117+
ERR=0
118+
else
119+
ERR=$?
118120
cat $JJFZF_TEMPD/status >&2
121+
fi
119122
rm -f $JJFZF_TEMPD/status
123+
exit $ERR
120124
)
121125
export -f jjfzf_status
122126

0 commit comments

Comments
 (0)