aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-14 07:33:40 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-14 07:33:40 +0200
commit203bfc28616a25b9001cea0a447612362dc8d7ec (patch)
treeb8a597978aa3662c9a2cc94011ad04e6d3c97b33
parent2748a9b16f91fe7fe06effc352cad14928ef7660 (diff)
downloadpatches-203bfc28616a25b9001cea0a447612362dc8d7ec.tar.gz
conv: Find root directory for Git repository
-rwxr-xr-xconv5
1 files changed, 3 insertions, 2 deletions
diff --git a/conv b/conv
index f5d2ebc..c7b6ffb 100755
--- a/conv
+++ b/conv
@@ -11,7 +11,7 @@ IFS='
# get patch description
if [ x"$1" = x"-i" ]; then
- f=`mktemp`
+ f=`mktemp -t ${0##*/}` || exit 1
echo 'Edit patch description...' > $f
</dev/tty >/dev/tty vi $f
c=`cat $f`
@@ -34,6 +34,7 @@ while read line; do
'--- a/'*)
file=${line#--- a/}
echo -n "--- $file.orig "
+ file=$(git rev-parse --show-toplevel)/$file
echo "$(stat -x "$file")" | sed -n 's/^Access: //p' ;;
'+++ b/'*)
echo "+++ ${line#+++ b/}" ;;
@@ -68,7 +69,7 @@ if [ x"$1" = x"-i" ]; then
# write patch if it doesn't already exist
if [ -e $dir/$name ]; then
- f=`mktemp`
+ f=`mktemp -t ${0##*/}` || exit 1
echo error: $dir/$name already exists; saving to $f 1>&2
exit 1
else