Skip to content

Commit

Permalink
scripts: make git-fetch-dev more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin committed Nov 10, 2020
1 parent 41bc58c commit 00772a3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/git-fetch-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ GIT_BRANCH=${2:-master}

cd "$ROOT"
git fetch "$GIT_ORIGIN"
git reset --hard "$GIT_ORIGIN/$GIT_BRANCH"

DEVTOOLS_SUBMODULE_COMMIT=$(git ls-tree HEAD | grep "devtools-frontend" | cut -d " " -f 3 | cut -d$'\t' -f 1)
REMOTE_HEAD="$GIT_ORIGIN/$GIT_BRANCH"
DEVTOOLS_SUBMODULE_COMMIT=$(git ls-tree "$REMOTE_HEAD" | grep "devtools-frontend" | cut -d " " -f 3 | cut -d$'\t' -f 1)

cd devtools-frontend
git fetch "$GIT_ORIGIN" HEAD

cd "$ROOT"
git reset --hard "$REMOTE_HEAD"

cd devtools-frontend
git checkout "$DEVTOOLS_SUBMODULE_COMMIT"

0 comments on commit 00772a3

Please sign in to comment.