Skip to content

Commit

Permalink
filter-branch: assume HEAD if no revision supplied
Browse files Browse the repository at this point in the history
filter-branch previously took the first non-option argument as the name for
a new branch. Since dfd05e3, it now takes a revision or a revision range
and modifies the current branch. Update to operate on HEAD by default to
conform with standard git interface practice.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
drafnel authored and gitster committed Jan 31, 2008
1 parent c41b439 commit 0f047f3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions git-filter-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ orig_namespace=refs/original/
force=
while :
do
test $# = 0 && usage
case "$1" in
--)
shift
Expand Down Expand Up @@ -213,7 +212,7 @@ GIT_WORK_TREE=.
export GIT_DIR GIT_WORK_TREE

# The refs should be updated if their heads were rewritten
git rev-parse --no-flags --revs-only --symbolic-full-name "$@" |
git rev-parse --no-flags --revs-only --symbolic-full-name --default HEAD "$@" |
sed -e '/^^/d' >"$tempdir"/heads

test -s "$tempdir"/heads ||
Expand Down

0 comments on commit 0f047f3

Please sign in to comment.