Skip to content

Commit bcd9558

Browse files
authored
Check for dirty files should not run on --rekey (#201)
2 parents e2a7d09 + 6b2f55d commit bcd9558

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

transcrypt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,6 +1669,11 @@ if [[ $rekey ]]; then
16691669
stage_rekeyed_files
16701670
else
16711671
force_checkout
1672+
# check for newly modified (dirty) files after transcrypt configuration which could
1673+
# indicate an incorrect password
1674+
if [[ ${GIT_DIRTY_FILES_BEFORE_INIT} -lt $(count_dirty_files) ]]; then
1675+
die 1 'Unexpected new dirty files in the repository when configured by transcrypt%s, please check your password.\n' "$CONTEXT_DESCRIPTION"
1676+
fi
16721677
fi
16731678

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

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

16881687
exit 0

0 commit comments

Comments
 (0)