Ver código fonte

Add --quick option to mfrb

Scott Lahteine 5 anos atrás
pai
commit
a073293b6a
1 arquivos alterados com 14 adições e 3 exclusões
  1. 14
    3
      buildroot/share/git/mfrb

+ 14
- 3
buildroot/share/git/mfrb Ver arquivo

@@ -5,15 +5,26 @@
5 5
 # Do "git rebase -i" against the "target" branch (bugfix-1.1.x, bugfix-2.0.x, or master)
6 6
 #
7 7
 
8
-[[ $# < 2 && $1 != "-h" && $1 != "--help" ]] || { echo "Usage: `basename $0` [1|2]" 1>&2 ; exit 1; }
9
-
10 8
 MFINFO=$(mfinfo "$@") || exit 1
11 9
 IFS=' ' read -a INFO <<< "$MFINFO"
12 10
 TARG=${INFO[3]}
13 11
 CURR=${INFO[5]}
14 12
 
13
+IND=6
14
+while [ $IND -lt ${#INFO[@]} ]; do
15
+  ARG=${INFO[$IND]}
16
+  case "$ARG" in
17
+    -q|--quick ) QUICK=1 ;;
18
+     -h|--help ) USAGE=1 ;;
19
+             * ) USAGE=1 ; echo "unknown option: $ARG" ;;
20
+  esac
21
+  let IND+=1
22
+done
23
+
24
+[[ $USAGE ]] && { echo "usage: `basename $0` [1|2]" 1>&2 ; exit 1 ; }
25
+
15 26
 # If the branch isn't currently the PR target
16 27
 if [[ $TARG != $CURR ]]; then
17
-  git fetch upstream
28
+  [[ $QUICK ]] || git fetch upstream
18 29
   git rebase upstream/$TARG && git rebase -i upstream/$TARG
19 30
 fi

Carregando…
Cancelar
Salvar