Skip to content

check for dirty files should not run on --rekey #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions transcrypt
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,11 @@ if [[ $rekey ]]; then
stage_rekeyed_files
else
force_checkout
# check for newly modified (dirty) files after transcrypt configuration which could
# indicate an incorrect password
if [[ ${GIT_DIRTY_FILES_BEFORE_INIT} -lt $(count_dirty_files) ]]; then
die 1 'Unexpected new dirty files in the repository when configured by transcrypt%s, please check your password.\n' "$CONTEXT_DESCRIPTION"
fi
fi

# ensure the git attributes file exists
Expand All @@ -1677,12 +1682,6 @@ if [[ ! -f $GIT_ATTRIBUTES ]]; then
printf '#pattern filter=crypt diff=crypt merge=crypt\n' >"$GIT_ATTRIBUTES"
fi

# check for newly modified (dirty) files after transcrypt configuration which could
# indicate an incorrect password
if [[ ${GIT_DIRTY_FILES_BEFORE_INIT} -lt $(count_dirty_files) ]]; then
die 1 'Unexpected new dirty files in the repository when configured by transcrypt%s, please check your password.\n' "$CONTEXT_DESCRIPTION"
fi

printf 'The repository has been successfully configured by transcrypt%s.\n' "$CONTEXT_DESCRIPTION"

exit 0