> $ sh getrevision.sh -U> fatal: ambiguous argument 'HEAD..->': unknown revision or path not in theThe problem is the output of git branch -r --contains HEAD:
> working tree.
> Use '--' to separate paths from revisions, like this:
> 'git <command> [<revision>...] -- [<file>...]'
> getrevision.sh: line 115: [: -ge: unary operator expected
> getrevision.sh: line 115: [: 0: unary operator expected
> http://git.chromium.org/chromiumos/third_party/flashrom.git master
>
> What about something like:
> git ls-remote --exit-code --get-url | sed 's/.*\/\///'
>
> That looks simpler and works better, at least in my testing...
origin/HEAD -> origin/master
origin/master
Namely the origin/HEAD pointing to another branch which specifies the
branch one checks out automatically when cloning the repository. I do
not have this in my working repository where I was testing because i did
add the chromium tree as a plain remote only...
I have attached another approach, now with:
branches=$(git branch -r --contains HEAD | sed 's/[\t ]*//;/.*->.*/d')