Skip to content

Commit

Permalink
Merge branch 'jk/maint-pull-dry-run-noop' into maint
Browse files Browse the repository at this point in the history
* jk/maint-pull-dry-run-noop:
  pull: do nothing on --dry-run
  • Loading branch information
Junio C Hamano committed Jun 21, 2010
2 parents cb2af93 + 29609e6 commit d0780b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion git-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ merge_args=
curr_branch=$(git symbolic-ref -q HEAD)
curr_branch_short="${curr_branch#refs/heads/}"
rebase=$(git config --bool branch.$curr_branch_short.rebase)
dry_run=
while :
do
case "$1" in
Expand Down Expand Up @@ -104,6 +105,9 @@ do
--no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase)
rebase=false
;;
--d|--dr|--dry|--dry-|--dry-r|--dry-ru|--dry-run)
dry_run=--dry-run
;;
-h|--h|--he|--hel|--help)
usage
;;
Expand Down Expand Up @@ -216,7 +220,8 @@ test true = "$rebase" && {
done
}
orig_head=$(git rev-parse -q --verify HEAD)
git fetch $verbosity $progress --update-head-ok "$@" || exit 1
git fetch $verbosity $progress $dry_run --update-head-ok "$@" || exit 1
test -z "$dry_run" || exit 0

curr_head=$(git rev-parse -q --verify HEAD)
if test -n "$orig_head" && test "$curr_head" != "$orig_head"
Expand Down

0 comments on commit d0780b0

Please sign in to comment.