Merge branch 'jk/filter-branch-require-clean-work-tree' into maint
authorJunio C Hamano <gitster@pobox.com>
Sun, 16 Oct 2011 03:46:38 +0000 (20:46 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 16 Oct 2011 03:46:38 +0000 (20:46 -0700)
* jk/filter-branch-require-clean-work-tree:
filter-branch: use require_clean_work_tree

1  2 
git-filter-branch.sh
diff --combined git-filter-branch.sh
index 804a7f4bc912ab0c9c51038456d9abe4216947a5,f5c4db6413bcc6f899bf20dae94eb13a72ed9908..add2c0247fa91e0f629428c295fc581f19cf85e1
@@@ -12,7 -12,7 +12,7 @@@
  
  functions=$(cat << \EOF
  warn () {
 -        echo "$*" >&2
 +      echo "$*" >&2
  }
  
  map()
@@@ -98,19 -98,17 +98,17 @@@ set_ident () 
  }
  
  USAGE="[--env-filter <command>] [--tree-filter <command>]
 -            [--index-filter <command>] [--parent-filter <command>]
 -            [--msg-filter <command>] [--commit-filter <command>]
 -            [--tag-name-filter <command>] [--subdirectory-filter <directory>]
 -            [--original <namespace>] [-d <directory>] [-f | --force]
 -            [<rev-list options>...]"
 +      [--index-filter <command>] [--parent-filter <command>]
 +      [--msg-filter <command>] [--commit-filter <command>]
 +      [--tag-name-filter <command>] [--subdirectory-filter <directory>]
 +      [--original <namespace>] [-d <directory>] [-f | --force]
 +      [<rev-list options>...]"
  
  OPTIONS_SPEC=
  . git-sh-setup
  
  if [ "$(is_bare_repository)" = false ]; then
-       git diff-files --ignore-submodules --quiet &&
-       git diff-index --cached --quiet HEAD -- ||
-       die "Cannot rewrite branch(es) with a dirty working directory."
+       require_clean_work_tree 'rewrite branches'
  fi
  
  tempdir=.git-rewrite