diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2023-11-18 19:32:11 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2024-03-01 00:22:54 +0100 |
commit | 45a4fea02fc05f10dd58512c8fbdca4adb23be65 (patch) | |
tree | adf9d703c7a224c4f8e5bb9d45bbd9c28d7a8cab /git-request-get | |
parent | 9c93d38f9d8e07ea01d2ee007c3c3f62156cbe6f (diff) | |
download | hlupak-45a4fea02fc05f10dd58512c8fbdca4adb23be65.tar.gz |
fix(git-request-get): Clean up unnecessary stuff.
Diffstat (limited to 'git-request-get')
-rwxr-xr-x | git-request-get | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/git-request-get b/git-request-get index 2ba5ec4..c85b681 100755 --- a/git-request-get +++ b/git-request-get @@ -14,8 +14,6 @@ s/[[:space:]]\+// s/\(=[[:digit:]]\{2\}\)\+$// /^\(http\|git\)/p }')" -# mapfile -t -c 1 -C 'cb() { [[ "$2" =~ (git|http|ssh):// ]] && printf "%s\n" "$2"; }; cb' URLS <<<"$STR" -# echo "$URLS[@]" # 2. Check it is in our remotes mapfile REMOTES < <(git remote -v|awk '{print $1,$2;}') @@ -27,15 +25,15 @@ for rem in "${REMOTES[@]}" ; do fi done -# 4. Create new branch -BEG="$(echo "$STR" | awk '/^The following changes since commit / { print $NF }' | sed -e 's/[=:]*$//')" +# 3. Find the tip of the offered branch END="$(echo "$STR" | awk '/^for you to fetch changes up to / { print $NF }' | sed -e 's/[=:]*$//')" -# 5. Fetch the remote +# 4. Fetch the remote if [[ -n "$REMOTE" ]] ; then - git fetch $REMOTE $END + git fetch "$REMOTE" "$END" else - git fetch $URL $END + git fetch "$URL" "$END" fi -git checkout -b _4review FETCH_HEAD +# 5. open new branch +git checkout -B _4review FETCH_HEAD |