diff options
author | John Ankarström <john@ankarstrom.se> | 2021-06-14 07:33:40 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-06-14 07:33:40 +0200 |
commit | 203bfc28616a25b9001cea0a447612362dc8d7ec (patch) | |
tree | b8a597978aa3662c9a2cc94011ad04e6d3c97b33 | |
parent | 2748a9b16f91fe7fe06effc352cad14928ef7660 (diff) | |
download | patches-203bfc28616a25b9001cea0a447612362dc8d7ec.tar.gz |
conv: Find root directory for Git repository
-rwxr-xr-x | conv | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |