Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2940)

Unified Diff: crup-runner.sh

Issue 12279006: Add --sync option, to only sync submodules. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | git-crsync » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crup-runner.sh
diff --git a/crup-runner.sh b/crup-runner.sh
index 65fec79bf6c2ce7b25a54d160064aab16a2c8c0f..e97d36456108bd7a12277595ffd648461d06f727 100755
--- a/crup-runner.sh
+++ b/crup-runner.sh
@@ -1,5 +1,21 @@
#!/bin/bash
+update_toplevel () {
+ # Don't "pull" if checkout is not on a named branch
+ if test "$2" = "pull" && ( ! git symbolic-ref HEAD >/dev/null 2>/dev/null ); then
+ first_args="$1 fetch"
+ else
+ first_args="$1 $2"
+ fi
+ shift 2
+ echo "[$solution] $first_args $@" 1>&2
+ $first_args $@ | sed "s/^/[$solution] /g" 1>&2
+ status=$?
+ if [ "$status" -ne 0 ]; then
+ exit $status
+ fi
+}
+
set_target_os () {
# Get the os we're building for. On first run, this will be unset.
target_os=$(git config target.os 2>/dev/null)
@@ -70,18 +86,9 @@ if [ "$solution" = "$1" ]; then
exit 0
fi
- # Don't "pull" if checkout is not on a named branch
shift
- if test "$2" = "pull" && ( ! git symbolic-ref HEAD >/dev/null 2>/dev/null ); then
- first_args="$1 fetch"
- else
- first_args="$1 $2"
- fi
- shift 2
- $first_args $@ | sed "s/^/[$solution] /g" 1>&2
- status=$?
- if [ "$status" -ne 0 ]; then
- exit $status
+ if test $# -ne 0; then
+ update_toplevel "$@"
fi
set_target_os
« no previous file with comments | « no previous file | git-crsync » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698