Skip to content

Commit

Permalink
pull-test.sh: avoid "git subtree pull" error
Browse files Browse the repository at this point in the history
Without a prior `git reset --hard`, `git subtree pull` fails with:

    fatal: working tree has modifications.  Cannot add.

Debugging with -d doesn't show any explanation and neither `git diff` nor `git
diff-index` show any modifications. The `git reset --hard` shouldn't be
necessary.
  • Loading branch information
pohly committed Nov 22, 2023
1 parent f9d5b9c commit c465088
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pull-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ CSI_RELEASE_TOOLS_DIR="$(pwd)"

# Update the other repo.
cd "$PULL_TEST_REPO_DIR"
git reset --hard # Shouldn't be necessary, but somehow is to avoid "fatal: working tree has modifications. Cannot add." (https://stackoverflow.com/questions/3623351/git-subtree-pull-says-that-the-working-tree-has-modifications-but-git-status-sa)
git subtree pull --squash --prefix=release-tools "$CSI_RELEASE_TOOLS_DIR" master
git log -n2

Expand Down

0 comments on commit c465088

Please sign in to comment.