getBranchName.sh 261 B

1234567891011
  1. #!/bin/bash
  2. # $1: username
  3. # $2: password/token
  4. # $3: pull request number
  5. if [ -z "$3" ] ; then
  6. git branch | grep '\*' | cut -d' ' -f2
  7. else
  8. curl 2>/dev/null -u "$1":"$2" "https://api.github.com/repos/nextcloud/talk-android/pulls/$3" | jq .head.ref
  9. fi