diff --git a/README b/README index 9565263..039021e 100644 --- a/README +++ b/README @@ -31,6 +31,7 @@ DEPENDENCIES To use git-crypt, you need: + * Git 1.6.0 or later * OpenSSL * For decrypted git diff output, Git 1.6.1 or later * For decrypted git blame output, Git 1.7.2 or later diff --git a/commands.cpp b/commands.cpp index fcd5851..2fd6df2 100644 --- a/commands.cpp +++ b/commands.cpp @@ -195,10 +195,13 @@ void init (const char* argv0, const char* keyfile) // 0. Check to see if HEAD exists. See below why we do this. bool head_exists = system("git rev-parse HEAD >/dev/null 2>/dev/null") == 0; - // 1. Make sure working directory is clean + // 1. Make sure working directory is clean (ignoring untracked files) + // We do this because we run 'git reset --hard HEAD' later and we don't + // want the user to lose any changes. 'git reset' doesn't touch + // untracked files so it's safe to ignore those. int status; std::string status_output; - status = exec_command("git status --porcelain", status_output); + status = exec_command("git status -uno --porcelain", status_output); if (status != 0) { std::clog << "git status failed - is this a git repository?\n"; std::exit(1);