Skip to content

Commit

Permalink
tools: improve in-repo check
Browse files Browse the repository at this point in the history
Signed-off-by: Karel Zak <kzak@redhat.com>
  • Loading branch information
karelzak committed Feb 19, 2025
1 parent ab28ac6 commit eeab82e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
7 changes: 3 additions & 4 deletions tools/git-tp-sync
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ while [[ $# -gt 0 ]]; do
esac
done

git rev-parse --is-inside-work-tree &> /dev/null
if [ "$?" -ne 0 ]; then
echo "Must be called within a Git working tree."
git rev-parse --is-inside-work-tree >/dev/null 2>&1 || {
echo "Error: Not inside a Git repository." >&2
exit 1
fi
}

# default to all dirs defined by TP_PROJECTS
if [ ${#DIRS[@]} -eq 0 ]; then
Expand Down
8 changes: 3 additions & 5 deletions tools/git-version-bump
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ if [ -z "$VERSION" ]; then
exit 1
fi

git rev-parse --is-inside-work-tree &> /dev/null
if [ "$?" -ne 0 ]; then
echo "Must be called within a Git working tree."
git rev-parse --is-inside-work-tree >/dev/null 2>&1 || {
echo "Error: Not inside a Git repository." >&2
exit 1
fi

}

function bump_news_version {
local version="$1"
Expand Down

0 comments on commit eeab82e

Please sign in to comment.