On 2017-8-15 20:29 , Ryan Schmidt wrote:

On Aug 15, 2017, at 02:50, Joshua Root <[email protected]> wrote:

Joshua Root (jmroot) pushed a commit to branch master
in repository macports-infrastructure.


https://github.com/macports/macports-infrastructure/commit/340d69f6294766bf360ac0b90c7f8b7d50e077cf

The following commit(s) were added to refs/heads/master by this push:

      new 340d69f  Update mprsyncup to use git instead of svn

340d69f is described below


commit 340d69f6294766bf360ac0b90c7f8b7d50e077cf

Author: Joshua Root <[email protected]>
AuthorDate: Tue Aug 15 02:12:34 2017 +1000


     Update mprsyncup to use git instead of svn

---
  jobs/mprsyncup | 63 ++++++++++++++++++++++++++++------------------------------
  1 file changed, 30 insertions(+), 33 deletions(-)


+if [ -d "${PORTS}/.git" ]; then
+    cd "${PORTS}"
+    PORTS_OLD_REV="$(${GIT} rev-parse HEAD)"
+    ${GIT} pull -q
+    PORTS_NEW_REV="$(${GIT} rev-parse HEAD)"
      [ "${PORTS_OLD_REV}" = "${PORTS_NEW_REV}" ] && PORTS_CHANGED=0
  else
-    ${SVN} -q checkout "${PORTSURL}" "${PORTS}"
+    ${GIT} clone -q --depth 1 "${PORTSURL}" "${PORTS}"
  fi
if [ "${RBASE_CHANGED}" -eq 1 ]; then

Could we have used "-C" arguments to the git commands instead of introducing 
"cd" commands?

Sure. In the quoted section there are multiple git commands in the same working directory, so it seemed less repetitious to cd once. Other places that's not the case.

There were cds in the script before this commit BTW.

- Josh

Reply via email to