ruby-changes:46220
From: nobu <ko1@a...>
Date: Thu, 13 Apr 2017 17:08:07 +0900 (JST)
Subject: [ruby-changes:46220] nobu:r58336 (trunk): git-refresh: for symlink srcdir
nobu 2017-04-13 17:08:04 +0900 (Thu, 13 Apr 2017) New Revision: 58336 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58336 Log: git-refresh: for symlink srcdir * tool/git-refresh: use `cd -P` for symlink srcdir. Modified files: trunk/tool/git-refresh Index: tool/git-refresh =================================================================== --- tool/git-refresh (revision 58335) +++ tool/git-refresh (revision 58336) @@ -1,15 +1,21 @@ https://github.com/ruby/ruby/blob/trunk/tool/git-refresh#L1 #!/bin/sh set -e +if cd -P . 2>/dev/null; then + CHDIR='cd -P' +else + CHDIR='cd' +fi + quiet= branch= until [ $# = 0 ]; do case "$1" in --) shift; break;; - -C|--directory) shift; cd "$1";; - -C*) cd `expr "$1" : '-C\(.*\)'`;; - --directory=*) cd `expr "$1" : '[^=]*=\(.*\)'`;; + -C|--directory) shift; $CHDIR "$1";; + -C*) $CHDIR `expr "$1" : '-C\(.*\)'`;; + --directory=*) $CHDIR `expr "$1" : '[^=]*=\(.*\)'`;; -q) quiet=1;; -b|--branch) shift; branch="$1";; -b*) branch=`expr "$1" : '-b\(.*\)'`;; @@ -26,7 +32,7 @@ shift 2 https://github.com/ruby/ruby/blob/trunk/tool/git-refresh#L32 if [ -d "$dir" ]; then echo updating `expr "/$dir/" : '.*/\([^/][^/]*\)/'` ... [ $quiet ] || set -x - cd "$dir" + $CHDIR "$dir" git fetch "$@" exec git checkout ${branch:+"$branch"} "$@" else -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/