aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/git/gen_git_source.py
diff options
context:
space:
mode:
authorGravatar Jacques Pienaar <jpienaar@google.com>2018-03-21 12:07:51 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-03-21 12:10:30 -0700
commit2d0531d72c7dcbb0e149cafdd3a16ee8c3ff357a (patch)
tree1179ecdd684d10c6549f85aa95f33dd79463a093 /tensorflow/tools/git/gen_git_source.py
parentcbede3ea7574b36f429710bc08617d08455bcc21 (diff)
Merge changes from github.
PiperOrigin-RevId: 189945839
Diffstat (limited to 'tensorflow/tools/git/gen_git_source.py')
-rwxr-xr-xtensorflow/tools/git/gen_git_source.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tensorflow/tools/git/gen_git_source.py b/tensorflow/tools/git/gen_git_source.py
index 3630dbd740..cbcdbf5b80 100755
--- a/tensorflow/tools/git/gen_git_source.py
+++ b/tensorflow/tools/git/gen_git_source.py
@@ -114,6 +114,13 @@ def configure(src_base_path, gen_path, debug=False):
for target, src in link_map.items():
if src is None:
open(os.path.join(gen_path, target), "w").write("")
+ elif not os.path.exists(src):
+ # Git repo is configured in a way we don't support such as having
+ # packed refs. Even though in a git repo, tf.__git_version__ will not
+ # be accurate.
+ # TODO(mikecase): Support grabbing git info when using packed refs.
+ open(os.path.join(gen_path, target), "w").write("")
+ spec["git"] = False
else:
try:
# In python 3.5, symlink function exists even on Windows. But requires