From b1ddf7e1cef48b0260320a42ae3d73711c9aaee9 Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Thu, 6 Nov 2014 20:07:50 +0100 Subject: [PATCH] fix --ln-untracked with relative directories We used to take files from the initial directory, which may or may not be the same as the directory containing the main file (e.g. --main foo/bar.tex), and link them to the directory corresponding to the checkout of the main file. Fix this, and always link files from the directory containing the main file. --- git-latexdiff | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/git-latexdiff b/git-latexdiff index ee024f0..72f92f9 100755 --- a/git-latexdiff +++ b/git-latexdiff @@ -55,7 +55,7 @@ If "--" is used for NEW, then diff against the working directory. Options: --help this help message - --main name of the main LaTeX file (must be in current directory!) + --main name of the main LaTeX file --no-view don't display the resulting PDF file --bibtex, -b run bibtex as well as latex (pdflatex,bibtex,pdflatex,pdflatex) @@ -144,6 +144,7 @@ bibtex=0 biber=0 output= initial_dir=$PWD +initial_repo=$(git rev-parse --show-toplevel) tmpdir_prefix="/tmp" prepare_cmd= flatten=1 @@ -420,7 +421,7 @@ verbose "Checking out old and new version" cd old || die "Cannot cd to old/" if test "$ln_untracked" = 1; then ( - mkdir -p "$maindir" && cd "$maindir" && ln -s "$initial_dir"/* . + mkdir -p "$maindir" && cd "$maindir" && ln -s "$initial_repo"/"$maindir"/* . ) fi @@ -436,7 +437,7 @@ verbose_progress cd ../new || die "Cannot cd to new/" if test "$ln_untracked" = 1; then ( - mkdir -p "$maindir" && cd "$maindir" && ln -s "$initial_dir"/* . + mkdir -p "$maindir" && cd "$maindir" && ln -s "$initial_repo"/"$maindir"/* . ) fi if test "$new" != "--"; then