diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-09-17 11:40:27 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-09-17 11:40:27 -0700 |
commit | 541dc4dfa07f70e66e244be566480ed4699b4fc9 (patch) | |
tree | 0d389b2e7743d39631d76e7e9dc552a5a8fe7694 /git-filter-branch.sh | |
parent | 9b4aa47e7d7c00c9a9225e316b520b62ddfb455c (diff) | |
parent | 83bd7437ca6acbee0db431fc8ec7cf823d9459ec (diff) | |
download | git-541dc4dfa07f70e66e244be566480ed4699b4fc9.tar.gz git-541dc4dfa07f70e66e244be566480ed4699b4fc9.tar.xz |
Merge branch 'jk/write-broken-index-with-nul-sha1'
Earlier we started rejecting an attempt to add 0{40} object name to
the index and to tree objects, but it sometimes is necessary to
allow so to be able to use tools like filter-branch to correct such
broken tree objects.
* jk/write-broken-index-with-nul-sha1:
write_index: optionally allow broken null sha1s
Diffstat (limited to 'git-filter-branch.sh')
-rwxr-xr-x | git-filter-branch.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh index ac2a005fd..98e8fe43d 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -283,11 +283,12 @@ while read commit parents; do case "$filter_subdir" in "") - git read-tree -i -m $commit + GIT_ALLOW_NULL_SHA1=1 git read-tree -i -m $commit ;; *) # The commit may not have the subdirectory at all - err=$(git read-tree -i -m $commit:"$filter_subdir" 2>&1) || { + err=$(GIT_ALLOW_NULL_SHA1=1 \ + git read-tree -i -m $commit:"$filter_subdir" 2>&1) || { if ! git rev-parse -q --verify $commit:"$filter_subdir" then rm -f "$GIT_INDEX_FILE" |