update_rerere_cache does not work correctly if drm-tip and $DIM_REPO are workdirs - it cannot locate properly rr-cache. Let's use git rev-parse to resolve rr-cache location. Signed-off-by: Andrzej Hajda <a.hajda@xxxxxxxxxxx> --- dim | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/dim b/dim index 3afa8b6..e4a4afe 100755 --- a/dim +++ b/dim @@ -554,15 +554,6 @@ function check_conflicts # tree true } -function rr_cache_dir -{ - if [ -d $DIM_PREFIX/drm-tip/.git/ ] ; then - echo $DIM_PREFIX/drm-tip/.git/rr-cache - else - echo $DIM_PREFIX/$DIM_REPO/.git/rr-cache - fi -} - function git_dir { local dir=${1:-$PWD} @@ -606,17 +597,25 @@ function pull_rerere_cache function update_rerere_cache { + local rr_cache_dir + echo -n "Updating rerere cache... " pull_rerere_cache - if [ ! -L $(rr_cache_dir) ] ; then - if [ -d $(rr_cache_dir) ] ; then - rm -Rf $(rr_cache_dir) + cd $DIM_PREFIX/drm-tip/ + + rr_cache_dir=$(git rev-parse --git-common-dir)/rr-cache + + if [ ! -L $rr_cache_dir ] ; then + if [ -d $rr_cache_dir ] ; then + rm -Rf $rr_cache_dir fi - ln -s "$DIM_PREFIX/drm-rerere/rr-cache" $(dirname $(rr_cache_dir)) + ln -s "$DIM_PREFIX/drm-rerere/rr-cache" $rr_cache_dir fi + cd ~- + echo "Done." } -- 2.17.1 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel