mirror of
				https://git.proxmox.com/git/libgit2
				synced 2025-11-04 07:09:14 +00:00 
			
		
		
		
	Now properly handling branches with "-g" in their names.
This commit is contained in:
		
							parent
							
								
									ec6a632a1b
								
							
						
					
					
						commit
						46c2ead05d
					
				@ -56,9 +56,9 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const
 | 
			
		||||
 | 
			
		||||
   /* "git describe" output; snip everything before/including "-g" */
 | 
			
		||||
   substr = strstr(spec, "-g");
 | 
			
		||||
   if (substr) {
 | 
			
		||||
      spec = substr + 2;
 | 
			
		||||
      speclen = strlen(spec);
 | 
			
		||||
   if (substr &&
 | 
			
		||||
       !revparse_lookup_object(out, repo, substr+2)) {
 | 
			
		||||
      return 0;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   /* SHA or prefix */
 | 
			
		||||
 | 
			
		||||
@ -66,6 +66,7 @@ void test_refs_revparse__partial_refs(void)
 | 
			
		||||
void test_refs_revparse__describe_output(void)
 | 
			
		||||
{
 | 
			
		||||
   test_object("blah-7-gc47800c", "c47800c7266a2be04c571c04d5a6614691ea99bd");
 | 
			
		||||
   test_object("not-good", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void test_refs_revparse__nth_parent(void)
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								tests/resources/testrepo.git/refs/heads/not-good
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								tests/resources/testrepo.git/refs/heads/not-good
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
		Loading…
	
		Reference in New Issue
	
	Block a user