summaryrefslogtreecommitdiff
path: root/git-filter-branch.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-09-01 21:53:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-09-15 23:58:55 (GMT)
commit5347a50fec066845e5dfa34a53cbec1ea347641d (patch)
tree4334cbdc61d31f5b8aa105c90fafeb090121be5e /git-filter-branch.sh
parent740a8fc2249cf7d8b39ab50a25bbf86554158ae7 (diff)
downloadgit-5347a50fec066845e5dfa34a53cbec1ea347641d.zip
git-5347a50fec066845e5dfa34a53cbec1ea347641d.tar.gz
git-5347a50fec066845e5dfa34a53cbec1ea347641d.tar.bz2
filter-branch: use require_clean_work_tree
Filter-branch already requires that we have a clean work tree before starting. However, it failed to refresh the index before checking, which means it could be wrong in the case of stat-dirtiness. Instead of simply adding a call to refresh the index, let's switch to using the require_clean_work_tree function provided by git-sh-setup. It does exactly what we want, and with fewer lines of code and more specific output messages. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-filter-branch.sh')
-rwxr-xr-xgit-filter-branch.sh4
1 files changed, 1 insertions, 3 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 6b5f225..f5c4db6 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -108,9 +108,7 @@ 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