From 69d55fb7f1ade82ad53f30ab24b1f61ad1f0f2bf Mon Sep 17 00:00:00 2001 From: Alex Leblang Date: Thu, 7 Sep 2017 12:31:53 -0400 Subject: [PATCH] HBASE-18020 (REOPENED) Fix Bug Where Branch Isn't Found While git rev-parse, sometimes the branch cannot be found unless the remote is specified. This fix tries to use "origin" if the remote is not specified and the branch is not found. --- dev-support/checkcompatibility.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dev-support/checkcompatibility.py b/dev-support/checkcompatibility.py index 0f90207..bba4f05 100755 --- a/dev-support/checkcompatibility.py +++ b/dev-support/checkcompatibility.py @@ -116,7 +116,12 @@ def checkout_java_tree(rev, path): def get_git_hash(revname): """ Convert 'revname' to its SHA-1 hash. """ - return check_output(["git", "rev-parse", revname], + try: + return check_output(["git", "rev-parse", revname], + cwd=get_repo_dir()).strip() + except: + revname = "origin/" + revname + return check_output(["git", "rev-parse", revname], cwd=get_repo_dir()).strip() -- 2.7.4 (Apple Git-66)