Skip to content

Commit aab68bc

Browse files
Merge pull request #44 from pH5/local-option
umpf: add -l|--local option as a shortcut to use local branches
2 parents c2580a2 + 9f041f9 commit aab68bc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

umpf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ usage() {
187187
-p, --patchdir <path> with format-patch: write patches to <path>/
188188
--relative <path> create patches relative to <path>
189189
-r, --remote <remote> use <remote> to resolve branch names
190+
-l, --local use local branches, alias for --remote refs/heads
190191
--override <topic>[=<commit-ish>]
191192
use commit-ish instead for the topic. May be
192193
specified more than once. If only <topic> is
@@ -238,8 +239,8 @@ setup() {
238239
GIT_FALLBACK_REMOTE="${tmp}"
239240
fi
240241

241-
o="fhisub:n:p:r:v:"
242-
l="auto-rerere,bb,nix,flags:,force,help,identical,stable,update,base:,name:,patchdir:,relative:,override:,remote:,version:"
242+
o="fhilsub:n:p:r:v:"
243+
l="auto-rerere,bb,nix,flags:,force,help,identical,stable,update,base:,name:,patchdir:,relative:,override:,remote:,local,version:"
243244
if ! args="$(getopt -n umpf -o "${o}" -l "${l}" -- "${@}")"; then
244245
usage
245246
exit 1
@@ -303,6 +304,9 @@ setup() {
303304
GIT_REMOTE="${1}"
304305
shift
305306
;;
307+
-l|--local)
308+
GIT_REMOTE="refs/heads"
309+
;;
306310
--override)
307311
IFS="=" read -r topic commitish <<< "${1}"
308312
if [ -n "${commitish}" ]; then

0 commit comments

Comments
 (0)