Browse Source

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.
master
Matthieu Moy 11 years ago
parent
commit
b1ddf7e1ce
  1. 7
      git-latexdiff

7
git-latexdiff

@ -55,7 +55,7 @@ If "--" is used for NEW, then diff against the working directory.
Options: Options:
--help this help message --help this help message
--main <file.tex> name of the main LaTeX file (must be in current directory!)
--main <file.tex> name of the main LaTeX file
--no-view don't display the resulting PDF file --no-view don't display the resulting PDF file
--bibtex, -b run bibtex as well as latex --bibtex, -b run bibtex as well as latex
(pdflatex,bibtex,pdflatex,pdflatex) (pdflatex,bibtex,pdflatex,pdflatex)
@ -144,6 +144,7 @@ bibtex=0
biber=0 biber=0
output= output=
initial_dir=$PWD initial_dir=$PWD
initial_repo=$(git rev-parse --show-toplevel)
tmpdir_prefix="/tmp" tmpdir_prefix="/tmp"
prepare_cmd= prepare_cmd=
flatten=1 flatten=1
@ -420,7 +421,7 @@ verbose "Checking out old and new version"
cd old || die "Cannot cd to old/" cd old || die "Cannot cd to old/"
if test "$ln_untracked" = 1; then 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 fi
@ -436,7 +437,7 @@ verbose_progress
cd ../new || die "Cannot cd to new/" cd ../new || die "Cannot cd to new/"
if test "$ln_untracked" = 1; then 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 fi
if test "$new" != "--"; then if test "$new" != "--"; then

Loading…
Cancel
Save