summaryrefslogtreecommitdiff
path: root/src/gitget
diff options
context:
space:
mode:
Diffstat (limited to 'src/gitget')
-rwxr-xr-xsrc/gitget/gitget4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gitget/gitget b/src/gitget/gitget
index 256b4e4..194ec05 100755
--- a/src/gitget/gitget
+++ b/src/gitget/gitget
@@ -191,6 +191,7 @@ main() {
*) usage >&2; return 1;;
esac
done
+ shift $(($OPTIND - 1))
[[ $# == 3 ]] || { usage >&2; return 1; }
local mode=$1
local url=${2#git+}
@@ -198,6 +199,9 @@ main() {
local urlmain=${url%%#*}
local urlfrag=${url#*#}
+ if [[ "$urlfrag" == "$urlmain" ]]; then
+ urlfrag=''
+ fi
local ref=${urlfrag#*=}
if [[ -z $ref ]]; then