commit-graph write: don't die if the existing graph is corrupt
[gitweb.git] / Documentation / doc-diff
index cece4fd537e6282c391ab6582bdd37f571ec4ee8..32c83dd26f4adf87fd9d6a3ebc6400f6bc108fc7 100755 (executable)
@@ -39,8 +39,7 @@ do
        shift
 done
 
-cd_to_toplevel
-tmp=Documentation/tmp-doc-diff
+tmp="$(git rev-parse --show-toplevel)/Documentation/tmp-doc-diff" || exit 1
 
 if test -n "$clean"
 then
@@ -75,7 +74,7 @@ fi
 # results that don't differ between the two trees.
 if ! test -d "$tmp/worktree"
 then
-       git worktree add --detach "$tmp/worktree" "$from" &&
+       git worktree add -f --detach "$tmp/worktree" "$from" &&
        dots=$(echo "$tmp/worktree" | sed 's#[^/]*#..#g') &&
        ln -s "$dots/config.mak" "$tmp/worktree/config.mak"
 fi
@@ -109,7 +108,7 @@ render_tree () {
                make -j$parallel -C "$tmp/worktree" \
                        GIT_VERSION=omitted \
                        SOURCE_DATE_EPOCH=0 \
-                       DESTDIR="$PWD/$tmp/installed/$1+" \
+                       DESTDIR="$tmp/installed/$1+" \
                        install-man &&
                mv "$tmp/installed/$1+" "$tmp/installed/$1"
        fi &&