aboutsummaryrefslogtreecommitdiff
path: root/git-stash.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-08-14 09:53:43 -0700
committerJunio C Hamano <gitster@pobox.com>2013-08-14 09:53:43 -0700
commitc1ebd90c832e28ff27654c21f9985aebe986352d (patch)
treef0f667fa35abcf6fd80c38ca988827f8f2c93225 /git-stash.sh
parent425df881e08bed7a8fcc9a23f452cff792f9ec6c (diff)
downloadgit-c1ebd90c832e28ff27654c21f9985aebe986352d.tar.gz
git-c1ebd90c832e28ff27654c21f9985aebe986352d.tar.xz
Revert "git stash: avoid data loss when "git stash save" kills a directory"
This reverts commit a73653130edd6a8977106d45a8092c09040f9132, as it has been reported that "ls-files --killed" is too time-consuming in a deep directory with too many untracked crufts (e.g. $HOME/.git tracking only a few files). We'd need to revisit it later but "ls-files --killed" needs to be optimized before it happens.
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-xgit-stash.sh12
1 files changed, 0 insertions, 12 deletions
diff --git a/git-stash.sh b/git-stash.sh
index 85c9e2c08..1e541a212 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -195,7 +195,6 @@ save_stash () {
keep_index=
patch_mode=
untracked=
- force=
while test $# != 0
do
case "$1" in
@@ -216,9 +215,6 @@ save_stash () {
-u|--include-untracked)
untracked=untracked
;;
- -f|--force)
- force=t
- ;;
-a|--all)
untracked=all
;;
@@ -262,14 +258,6 @@ save_stash () {
say "$(gettext "No local changes to save")"
exit 0
fi
- if test -z "$untracked$force" &&
- test -n "$(git ls-files --killed | head -n 1)"
- then
- say "$(gettext "The following untracked files would NOT be saved but need to be removed by stash save:")"
- test -n "$GIT_QUIET" || git ls-files --killed | sed 's/^/\t/'
- say "$(gettext "Aborting. Consider using either the --force or --include-untracked option.")" >&2
- exit 1
- fi
test -f "$GIT_DIR/logs/$ref_stash" ||
clear_stash || die "$(gettext "Cannot initialize stash")"