Skip to content

Commit db71be5

Browse files
authored
git archive-file: change base ARCHIVE_NAME (tj#1071)
Closes tj#1067 This makes the base ARCHIVE_NAME for `git-archive-file` to be the name of the repo root directory instead of the name of the current directory.
1 parent cb29c62 commit db71be5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/git-archive-file

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env bash
22

33
# extract current branch name
4-
BRANCH=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
4+
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
55

66
# get name of the most top folder of current directory, used for the
77
# output filename
8-
ARCHIVE_NAME=$(basename "$PWD")
8+
ARCHIVE_NAME=$(basename "$(git rev-parse --show-toplevel)")
99

1010
if [[ $BRANCH = tags* ]]; then
1111
BRANCH=$(git describe)

0 commit comments

Comments
 (0)