mirror of https://github.com/garrytan/gstack.git
fix(slug): replace slash in branch name instead of deleting it
Aligns gstack-slug with ship Step 8's tr '/' '-' so gstack-review-log and gstack-review-read stop writing feat/foo to featfoo while other writers use feat-foo. The [a-zA-Z0-9._-] invariant promised in the file header still holds; tr -cd remains the final filter. Refs #1127
This commit is contained in:
parent
a3259400a3
commit
af9fe63b0c
|
|
@ -49,7 +49,7 @@ if [[ -n "$SLUG" ]]; then
|
|||
fi
|
||||
|
||||
RAW_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) || RAW_BRANCH=""
|
||||
BRANCH=$(printf '%s' "${RAW_BRANCH:-}" | tr -cd 'a-zA-Z0-9._-')
|
||||
BRANCH=$(printf '%s' "${RAW_BRANCH:-}" | tr '/' '-' | tr -cd 'a-zA-Z0-9._-')
|
||||
BRANCH="${BRANCH:-unknown}"
|
||||
echo "SLUG=$SLUG"
|
||||
echo "BRANCH=$BRANCH"
|
||||
|
|
|
|||
Loading…
Reference in New Issue