diff --git a/README.md b/README.md index ab2637e8..57a37a67 100644 --- a/README.md +++ b/README.md @@ -562,6 +562,8 @@ the case. * `.git/branch`: Name of the original branch that was cloned. +* `.git/branches_list.json`: List of all branches (requires `all_branches` set to `true`). + * `.git/tags`: Comma-separated list of tags associated with this commit. * `.git/author`: Commit author name. diff --git a/assets/in b/assets/in index 7c50dda4..3f074f27 100755 --- a/assets/in +++ b/assets/in @@ -311,6 +311,11 @@ git log -1 --format=%cd --date=${timestamp_format} > .git/commit_timestamp # a custom tag, or package to publish echo "$(git describe ${describe_ref_options})" > .git/describe_ref +if [ "${all_branches,,}" == "true" ]; then + git for-each-ref --format '%(refname:lstrip=3)' --exclude 'refs/remotes/*/HEAD' refs/remotes \ + | jq --raw-input --slurp --compact-output 'split("\n")[:-1]' > .git/branches_list.json +fi + if [ "$clean_tags" == "true" ]; then git tag | xargs git tag -d