-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Windows and maintain separate git index when running container
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
if test -z "$OSU_WIKI_MSYS"; then | ||
exec "$@" | ||
fi | ||
|
||
mv -T .git/index .git/index-host | ||
|
||
if test -f .git/index-container; then | ||
mv -T .git/index-container .git/index | ||
else | ||
printf '\033[1m## This is your first time running the Docker container.\n' >&2 | ||
printf '## A separate git index needs to be maintained when using this container on Windows.\n' >&2 | ||
printf '## Please \033[4mDO NOT\033[0;1m run any git commands while this container is running.\n' >&2 | ||
printf '## Creating index... (this may take a while)\033[m\n' >&2 | ||
git reset >/dev/null 2>&1 | ||
printf '\033[1;32m## Created index. It will be stored at \033[4m.git/index-container\033[0;1;32m.\033[m\n' >&2 | ||
fi | ||
|
||
"$@" && : | ||
|
||
exit_code=$? | ||
|
||
mv -T .git/index .git/index-container | ||
mv -T .git/index-host .git/index | ||
|
||
exit "$exit_code" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters