Fix crash when you have repository with no tags (like a forked repo) (#343)
This commit is contained in:
		
							
								
								
									
										2
									
								
								util.py
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								util.py
									
									
									
									
									
								
							@@ -457,7 +457,7 @@ def get_snapshot_version():
 | 
				
			|||||||
        try:
 | 
					        try:
 | 
				
			||||||
            ret = subprocess.check_output(["git", "describe", "--tags"]).strip()
 | 
					            ret = subprocess.check_output(["git", "describe", "--tags"]).strip()
 | 
				
			||||||
            ver = ret.decode("utf-8")
 | 
					            ver = ret.decode("utf-8")
 | 
				
			||||||
        except FileNotFoundError:
 | 
					        except (FileNotFoundError, subprocess.CalledProcessError):
 | 
				
			||||||
            try:
 | 
					            try:
 | 
				
			||||||
                with open(os.path.join(root_dir, ".git/refs/heads/master")) as f:
 | 
					                with open(os.path.join(root_dir, ".git/refs/heads/master")) as f:
 | 
				
			||||||
                    ver = "g" + f.read()[:7]
 | 
					                    ver = "g" + f.read()[:7]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user