Добавлен фильтр по исключению пустых строк в ответе от git-вызова, так как ответ может быть пустым
This commit is contained in:
		
							parent
							
								
									016455d8f2
								
							
						
					
					
						commit
						9f8759238b
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -86,7 +86,7 @@ class SnagRules {
 | 
				
			||||||
		git(
 | 
							git(
 | 
				
			||||||
			["diff", "--cached", "--name-only"],
 | 
								["diff", "--cached", "--name-only"],
 | 
				
			||||||
			"Failed to retrieve the list of files removed from tracking"
 | 
								"Failed to retrieve the list of files removed from tracking"
 | 
				
			||||||
		).output.split('\n')[0..$-1].each!(
 | 
							).output.split('\n').filter!(e => !e.strip.empty).each!(
 | 
				
			||||||
			file =>	git(
 | 
								file =>	git(
 | 
				
			||||||
				["add", "-f", file],
 | 
									["add", "-f", file],
 | 
				
			||||||
				"Failed to restore the file to tracking"
 | 
									"Failed to restore the file to tracking"
 | 
				
			||||||
| 
						 | 
					@ -98,7 +98,7 @@ class SnagRules {
 | 
				
			||||||
		git(
 | 
							git(
 | 
				
			||||||
			["ls-files", "-i", "-c", "--exclude-standard"],
 | 
								["ls-files", "-i", "-c", "--exclude-standard"],
 | 
				
			||||||
			"Failed to get the list of files to remove from tracking"
 | 
								"Failed to get the list of files to remove from tracking"
 | 
				
			||||||
		).output.split('\n')[0..$-1].each!(
 | 
							).output.split('\n').filter!(e => !e.strip.empty).each!(
 | 
				
			||||||
			file =>	git(
 | 
								file =>	git(
 | 
				
			||||||
				["rm", "--cached", file],
 | 
									["rm", "--cached", file],
 | 
				
			||||||
				"Failed to remove file from tracking"
 | 
									"Failed to remove file from tracking"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue