6657: check git is installed in arv-copy
[arvados.git] / sdk / python / arvados / commands / arv_copy.py
index 1d10b042729f1712a896a4d1d17c1a01d1cef29c..5e48bc4831e577560f1ea41b300cce7f5d19a3f5 100755 (executable)
@@ -589,6 +589,12 @@ def copy_collection(obj_uuid, src, dst, args):
 #    to both repositories.
 #
 def copy_git_repo(src_git_repo, src, dst, dst_git_repo, script_version, args):
+    # Check if git is available
+    try:
+        arvados.util.run_command(['git', '--help'])
+    except:
+        raise Exception('git command is not available. Please ensure git is installed.')
+
     # Identify the fetch and push URLs for the git repositories.
     r = src.repositories().list(
         filters=[['name', '=', src_git_repo]]).execute(num_retries=args.retries)