From 1ee5ebc4ff8e06b628e388525951c8104d15046a Mon Sep 17 00:00:00 2001
From: Austin Ziegler <austin@zieglers.ca>
Date: Mon, 11 Sep 2023 09:33:33 -0400
Subject: [PATCH] git archive-file: change base ARCHIVE_NAME

Closes #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.
---
 bin/git-archive-file | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/git-archive-file b/bin/git-archive-file
index 92c2338ad..681b951f7 100755
--- a/bin/git-archive-file
+++ b/bin/git-archive-file
@@ -1,11 +1,11 @@
 #!/usr/bin/env bash
 
 # extract current branch name
-BRANCH=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
+BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
 
 # get name of the most top folder of current directory, used for the
 # output filename
-ARCHIVE_NAME=$(basename "$PWD")
+ARCHIVE_NAME=$(basename "$(git rev-parse --show-toplevel)")
 
 if [[ $BRANCH = tags* ]]; then
     BRANCH=$(git describe)