Browse Source

sde-create-manifest: improved manifest_scan_git() to detect the currently tracked remote branch

user/amery/wip/manifest
Alejandro Mery 14 years ago
parent
commit
48a13c2b0c
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      bin/sde-create-manifest

+ 7
- 3
bin/sde-create-manifest

@ -40,8 +40,12 @@ manifest_scan_svn() {
}
manifest_scan_git() {
local dir="${1%/*}" repo=$(GIT_DIR="$1" git config --get remote.origin.url)
local proto="${repo%%://*}"
local dir="${1%/*}" branch= branch0= remote= repo= proto=
branch=$(GIT_DIR="$1" git branch | grep ^* | cut -c3-)
remote=$(GIT_DIR="$1" git config --get "branch.$branch.remote")
branch0=$(GIT_DIR="$1" git config --get "branch.$branch.merge" | cut -d/ -f3-)
repo=$(GIT_DIR="$1" git config --get "remote.$remote.url")
proto="${repo%%://*}"
case "$proto" in
ssh) proto="git+ssh"
@ -49,7 +53,7 @@ manifest_scan_git() {
;;
esac
echo "$dir $repo"
echo "$dir $repo $branch0"
}

Loading…
Cancel
Save