Re: [JGIT PATCH 03/22] Added a class Project which represents a project directory and it's repository.
- From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
- Date
- May 10, 2008, 20:45 UTC
- Message-ID
- <200805102245.16575.robin.rosenberg.lists@dewire.com>
- In-Reply-To
- <1210424440-13886-4-git-send-email-florianskarten@web.de>
lördagen den 10 maj 2008 15.00.21 skrev Florian Koeberle:
Show 23 quoted lines
> Signed-off-by: Florian Koeberle <florianskarten@web.de>
> +public class GitPathConstants {
> + /**
> + * The name of the repository directory in the project directory.
> + */
> + public static final String REPOSITORY_DIRECTORY_NAME = ".git";
> +
> + /**
> + * Contains the name of the objects directory in the repository directory.
> + */
> + public static final String OBJECTS_DIRECTORY_NAME = "objects";
> +
> + /**
> + * Contains the name of the refs directory in the repository directory.
> + */
> + public static final String REFS_DIRECTORY_NAME = "refs";
> +
> + /**
> + * Contains the name of the HEAD file in the repository directory.
> + */
> + public static final String HEAD_FILE_NAME = "HEAD";
> +
> +}Some of these we have as constansts in the Constants class. We should use them and put the new ones there too. I think we have a few literals of our own that should go there tool. Don't be afraid of proposing changes to other people's code. We don't territories.
Show 5 quoted lines
> diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Project.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Project.java > new file mode 100644 > index 0000000..6e72486 > --- /dev/null > +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Project.java
This term is also used by Eclipse and has a different meaning. Could we use something else, maybe WorkTree?
> +public class ProjectFactory {Let Repository be the factory.
Show 7 quoted lines
> + } catch (RuntimeException e) {
> + repository.close();
> + throw e;
> + } catch (IOException e) {
> + repository.close();
> + throw e;
> + }Why not finally() handling all Exceptions?
-- robin