Browse Source

builddir relative to . or to Git's root depending on whether --whole-tree is used

9e5967f (Implement build-dir option, 2019-02-13) introduced a
--build-dir option. Unfortunately, the build directory was considered
relative to the repository root, not to the current directory. When
--whole-tree is not used and the main file was in a sub-directory, the
PDF was generated in e.g. subtree/file.pdf, and looked for in
./file.pdf.
master
Matthieu Moy 6 years ago
parent
commit
38a9c46a47
  1. 19
      git-latexdiff

19
git-latexdiff

@ -537,13 +537,6 @@ fi
mainbase=$(basename "$main" .tex)
maindir=$(dirname "$main")
# create the build directory (containing the final PDFs) if the param was set
if test -n "$use_build_dir" ; then
builddir="$maindir/$use_build_dir"
else
builddir="$maindir"
fi
tmpdir=$tmpdir_prefix/git-latexdiff.$$
mkdir "$tmpdir" || die "Cannot create temporary directory."
@ -570,8 +563,20 @@ fi
if test "$subtree" = 1 && test -n "$git_prefix"; then
checkoutroot=$git_prefix
# create the build directory (containing the final PDFs) if the param was set
if test -n "$use_build_dir" ; then
builddir="$use_build_dir"
else
builddir="."
fi
else
checkoutroot="."
# create the build directory (containing the final PDFs) if the param was set
if test -n "$use_build_dir" ; then
builddir="$git_prefix/$use_build_dir"
else
builddir="$git_prefix"
fi
fi
# Checkout a subtree, without touching the index ("git checkout" would)

Loading…
Cancel
Save