git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[FYI/PATCH] Git.pm: add missing semicolon

From
LWLea Wiemann <lewiemann@gmail.com>
Date
Jun 13, 2008, 23:22 UTC
Message-ID
<1213399366-3539-1-git-send-email-LeWiemann@gmail.com>
---

There is obviously a semicolon missing after the try/catch block; without the semicolon '$opts{Repository} = abs_path($dir);' becomes an argument to the try function. The code (apparently?) never gets exercised in any test case, but I don't understand it well enough to write a test case or determine whether it's correct now.

Hence this patch is not for inclusion (from my end at least). I'm posting it just FYI and in case anyone wants to take a look.

diff --git a/perl/Git.pm b/perl/Git.pm
index 97e61ef..ea6f13f 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -207,13 +207,13 @@ sub repository {
 			my $search = Git->repository(Repository => $dir);
 			try {
 				$search->command('symbolic-ref', 'HEAD');
 			} catch Git::Error::Command with {
 				# Mimick git-rev-parse --git-dir error message:
 				throw Error::Simple('fatal: Not a git repository');
-			}
+			};
 
 			$opts{Repository} = abs_path($dir);
 		}
 
 		delete $opts{Directory};
 	}
-- 
1.5.6.rc2.51.g3f3f7.dirty
Message 1 of 1 in “Git.pm: add missing semicolon”
  1. Git.pm: add missing semicolonLea Wiemann, Jun 13, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.