Merge pull request #11 from bessl/patch-2
Merge pull request #11 from bessl/patch-2

Update gitphp.po

--- a/include/Util.class.php
+++ b/include/Util.class.php
@@ -68,10 +68,10 @@
 	public static function MakeSlug($str)
 	{
 		$from = array(
-			'/'
+			'/&'
 		);
 		$to = array(
-			'-'
+			'--'
 		);
 		return str_replace($from, $to, $str);
 	}

--- a/include/git/archive/Archive_Bzip2.class.php
+++ b/include/git/archive/Archive_Bzip2.class.php
@@ -70,7 +70,7 @@
 
 		$args = array();
 		$args[] = '--format=tar';
-		$args[] = '--prefix=' . $archive->GetPrefix();
+		$args[] = "--prefix='" . $archive->GetPrefix() . "'";
 		$args[] = $archive->GetObject()->GetHash();
 
 		$this->handle = $this->exe->Open($archive->GetProject()->GetPath(), GIT_ARCHIVE, $args);

--- a/include/git/archive/Archive_Gzip.class.php
+++ b/include/git/archive/Archive_Gzip.class.php
@@ -77,7 +77,7 @@
 
 		$args = array();
 		$args[] = '--format=tar';
-		$args[] = '--prefix=' . $archive->GetPrefix();
+		$args[] = "--prefix='" . $archive->GetPrefix() . "'";
 		$args[] = $archive->GetObject()->GetHash();
 
 		$this->handle = $this->exe->Open($archive->GetProject()->GetPath(), GIT_ARCHIVE, $args);

--- a/include/git/archive/Archive_Tar.class.php
+++ b/include/git/archive/Archive_Tar.class.php
@@ -50,7 +50,7 @@
 
 		$args = array();
 		$args[] = '--format=tar';
-		$args[] = '--prefix=' . $archive->GetPrefix();
+		$args[] = "--prefix='" . $archive->GetPrefix() . "'";
 		$args[] = $archive->GetObject()->GetHash();
 
 		$this->handle = $this->exe->Open($archive->GetProject()->GetPath(), GIT_ARCHIVE, $args);

--- a/include/git/archive/Archive_Zip.class.php
+++ b/include/git/archive/Archive_Zip.class.php
@@ -72,7 +72,7 @@
 		$args[] = '--format=zip';
 		if ($this->compressLevel)
 			$args[] = '-' . $this->compressLevel;
-		$args[] = '--prefix=' . $archive->GetPrefix();
+		$args[] = "--prefix='" . $archive->GetPrefix() . "'";
 		$args[] = $archive->GetObject()->GetHash();
 
 		$this->handle = $this->exe->Open($archive->GetProject()->GetPath(), GIT_ARCHIVE, $args);

--- a/include/git/projectlist/ProjectListFile.class.php
+++ b/include/git/projectlist/ProjectListFile.class.php
@@ -130,9 +130,11 @@
 			if (preg_match('/^([^\s]+)(\s.+)?$/', $line, $regs)) {
 				$data = array();
 				$data['project'] = $regs[1];
-				$owner = trim($regs[2]);
-				if (!empty($owner)) {
-					$data['owner'] = $owner;
+				if (isset($regs[2])){
+					$owner = trim($regs[2]);
+					if (!empty($owner)) {
+						$data['owner'] = $owner;
+					}
 				}
 				$this->fileContents[] = $data;
 			}

--- a/include/git/taglist/TagList.class.php
+++ b/include/git/taglist/TagList.class.php
@@ -96,12 +96,12 @@
 		foreach ($tagNames as $tag) {
 			if (isset($this->commits[$tag])) {
 				if ($this->commits[$tag] == $commitHash) {
-					$tagObj = $this->project->GetObjectManager()->GetTag($tag, $commitHash);
+					$tagObj = $this->project->GetObjectManager()->GetTag($tag, $this->refs[$tag]);
 					$tagObj->SetCommitHash($this->commits[$tag]);
 					$tags[] = $tagObj;
 				}
 			} else {
-				$tagObj = $this->project->GetObjectManager()->GetTag($tag, $commitHash);
+				$tagObj = $this->project->GetObjectManager()->GetTag($tag, $this->refs[$tag]);
 				$tagCommitHash = $tagObj->GetCommitHash();
 				if (!empty($tagCommitHash)) {
 					$this->commits[$tag] = $tagCommitHash;
@@ -122,7 +122,7 @@
 		$this->dataLoaded = true;
 
 		list($this->refs, $this->commits) = $this->strategy->Load($this);
-		foreach ($this->refs as $ref => $hash) $this->invertedRefs[$hash][] = $ref;
+		foreach ($this->commits as $ref => $hash) $this->invertedRefs[$hash][] = $ref;
 	}
 
 	/**

--- a/include/git/taglist/TagListLoad_Git.class.php
+++ b/include/git/taglist/TagListLoad_Git.class.php
@@ -17,7 +17,16 @@
 	 */
 	public function Load($tagList)
 	{
-		return $this->GetRefs($tagList, 'tags');
+		list($tags, $commits) = $this->GetRefs($tagList, 'tags');
+		
+		foreach ($tags as $tag => $tagHash) {
+			if (empty($commits[$tag])) {
+				// tag has no dereferenced hash - must be a light tag
+				$commits[$tag] = $tagHash;
+			}
+		}
+		
+		return array($tags, $commits);
 	}
 
 	/**

--- a/include/git/taglist/TagListLoad_Raw.class.php
+++ b/include/git/taglist/TagListLoad_Raw.class.php
@@ -17,7 +17,17 @@
 	 */
 	public function Load($tagList)
 	{
-		return array($this->GetRefs($tagList, 'tags'), array());
+		$tags = $this->GetRefs($tagList, 'tags');
+		$commits = array();
+		$objManager = $tagList->GetProject()->GetObjectManager();
+		foreach ($tags as $tag => $tagHash) {
+			$tagObj = $objManager->GetTag($tag, $tagHash);
+			$commitHash = $tagObj->GetCommitHash();
+			if (!empty($commitHash)) {
+				$commits[$tag] = $commitHash;
+			}
+		}
+		return array($tags, $commits);
 	}
 
 	/**

--- a/locale/de_DE/gitphp.po
+++ b/locale/de_DE/gitphp.po
@@ -131,7 +131,7 @@
 # %2: the mode
 #: templates/commit.tpl
 msgid "new %1 with mode %2"
-msgstr ""
+msgstr "Neu %1 mit Modus %2"
 
 # Used to indicate a new object was added
 # %1: the type of object
@@ -153,7 +153,7 @@
 # %4: the new file mode
 #: templates/commit.tpl
 msgid "changed from %1 to %2 mode: %3 -> %4"
-msgstr ""
+msgstr "geändert von %1 zu %2 Modus: %3 -> %4"
 
 # Used to indicate a file type changed, with only new file mode
 # (when old file type wasn't a normal file)
@@ -163,27 +163,27 @@
 # %4: the new file mode
 #: templates/commit.tpl
 msgid "changed from %1 to %2 mode: %3"
-msgstr ""
+msgstr "geändert von %1 zu %2 Modus %3"
 
 # Used to indicate a file type changed
 # %1: the original file type
 # %2: the new file type
 #: templates/commit.tpl
 msgid "changed from %1 to %2"
-msgstr ""
+msgstr "geändert von %1 zu %2"
 
 # Used to indicate a file mode changed
 # %1: the original file mode
 # %2: the new file mode
 #: templates/commit.tpl
 msgid "changed mode: %1 -> %2"
-msgstr ""
+msgstr "geänderter Modus: %1 -> %2"
 
 # Used to indicate a file mode changed
 # %1: the new file mode
 #: templates/commit.tpl
 msgid "changed mode: %1"
-msgstr ""
+msgstr "geänderter Modus: %1"
 
 # Used to indicate a file mode changed
 #: templates/commit.tpl
@@ -202,7 +202,7 @@
 # %3: the new file mode
 #: templates/commit.tpl
 msgid "moved from %1 with %2%% similarity, mode: %3"
-msgstr ""
+msgstr "verschoben von %1 mit %2%% der selbe Modus: %3"
 
 # Used to indicate a file was moved
 # This string should be HTML safe
@@ -210,7 +210,7 @@
 # %2: the similarity as a percent number
 #: templates/commit.tpl
 msgid "moved from %1 with %2%% similarity"
-msgstr ""
+msgstr "verschoben von %1 mit %2%% das selbe"
 
 # Used as title for and link to the compact log view with one line abbreviated commits
 #: templates/headlist.tpl templates/nav.tpl templates/taglist.tpl
@@ -278,7 +278,7 @@
 # Used as link to and title for page showing all heads in a project
 #: templates/title.tpl include/controller/Controller_Heads.class.php:76
 msgid "heads"
-msgstr ""
+msgstr "Heads"
 
 # Used when diffing a file, to indicate that it's been deleted
 #: templates/commitdiff.tpl
@@ -309,12 +309,12 @@
 # Used to label the url that users can use to clone the project
 #: templates/project.tpl
 msgid "clone url"
-msgstr "Klone URL (clone)"
+msgstr "Clone URL"
 
 # Used to label the url that users can use to push commits to the project
 #: templates/project.tpl
 msgid "push url"
-msgstr "Patch URL (push)"
+msgstr "Push URL"
 
 # Used as the header for the project name column
 #: templates/projectlist.tpl
@@ -439,7 +439,7 @@
 # A type of filesystem object stored in a project
 #: include/git/Blob.class.php:185
 msgid "symlink"
-msgstr "symlink"
+msgstr "Symlink"
 
 # Used when an object is stored in a project but git doesn't know what type it is
 #: include/git/Blob.class.php:198
@@ -466,7 +466,7 @@
 #: include/git/Project.class.php:220
 #, php-format
 msgid "%1$s is attempting directory traversal"
-msgstr ""
+msgstr "%1$s versucht eine Pfad Manipulation "
 
 # Error message when a path specified is outside of the project root
 # %1$s: The specified path
@@ -562,7 +562,7 @@
 # Used to represent a modification time of right now
 #: include/smartyplugins/modifier.agestring.php:51
 msgid "right now"
-msgstr ""
+msgstr "gerade eben"
 
 # Error message when user hasn't defined a project root in the config
 # "projectroot" refers to a root directory where the user's git projects are stored
@@ -626,7 +626,7 @@
 # language to the user's choice
 #: templates/header.tpl
 msgid "set"
-msgstr ""
+msgstr "einstellen"
 
 # Caption for the Atom button for a project
 # Atom is a standard web feed format
@@ -645,19 +645,19 @@
 #: include/smartyplugins/cacheresource.memcache.php:85
 msgid ""
 "The Memcached or Memcache PHP extension is required for Memcache support"
-msgstr ""
+msgstr "Memcached oder die Memcache PHP Erweiterung ist notwendig für Memcache Unterstützung"
 
 # Message when searching the project list, and nothing is found
 # %1: the search string entered
 #: templates/jsconst.tpl
 #: templates/projectlist.tpl
 msgid "No matches found for \"%1\""
-msgstr ""
+msgstr "Nichts gefunden zu \"%1\""
 
 # Label for the field to search the project list
 #: templates/projectlist.tpl
 msgid "Search projects"
-msgstr ""
+msgstr "Durchsuche Projekte"
 
 # Error message displayed when the git executable isn't found or doesn't work
 # %1$s: the git executable the system is trying to run
@@ -674,7 +674,7 @@
 # This will go back to showing all files in the commitdiff
 #: templates/commitdiff.tpl
 msgid "(show all)"
-msgstr ""
+msgstr "(alle anzeigen)"
 
 # Message displayed when diffing two binary files.
 # %1$s: the filename of the first file
@@ -682,12 +682,12 @@
 #: include/git/FileDiff.class.php:810
 #, php-format
 msgid "Binary files %1 and %2 differ"
-msgstr ""
+msgstr "Binäre Dateien %1 und %2 unterscheiden sich"
 
 # Used to label the url of the website of the project
 #: templates/project.tpl
 msgid "website"
-msgstr ""
+msgstr "Website"
 
 # This is the name of YOUR language, in your language.
 # Don't just translate the word "English".

comments