|
| 1 | +""" |
| 2 | +Copyright (c) 2015 Functional Software, Inc and individual contributors. |
| 3 | +All rights reserved. |
| 4 | +
|
| 5 | +Redistribution and use in source and binary forms, with or without modification, |
| 6 | +are permitted provided that the following conditions are met: |
| 7 | +
|
| 8 | + 1. Redistributions of source code must retain the above copyright notice, |
| 9 | + this list of conditions and the following disclaimer. |
| 10 | +
|
| 11 | + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the |
| 12 | + following disclaimer in the documentation and/or other materials provided with the distribution. |
| 13 | +
|
| 14 | + 3. Neither the name of the Raven nor the names of its contributors may be used to endorse or promote products |
| 15 | + derived from this software without specific prior written permission. |
| 16 | +
|
| 17 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, |
| 18 | +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 19 | +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 20 | +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 21 | +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 22 | +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 | +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | +""" |
| 25 | + |
1 | 26 | import os.path |
2 | 27 |
|
| 28 | + |
3 | 29 | def fetch_git_sha(path, head=None): |
4 | 30 | if not head: |
5 | 31 | head_path = os.path.join(path, '.git', 'HEAD') |
|
0 commit comments