Permalink
Browse files

moved git_object stuff into its own compilation unit.

  • Loading branch information...
1 parent 9de1cfd commit d8c187d70c6a86aa6c16a5c3031fb0dca417dc5b Sam Day committed May 25, 2012
Showing with 24 additions and 17 deletions.
  1. +1 −0 binding.gyp
  2. +19 −0 src/git_object.cc
  3. +4 −17 src/git_object.h
View
@@ -4,6 +4,7 @@
'target_name': 'gitteh',
'sources': [
'src/gitteh.cc',
+ 'src/git_object.cc',
'src/signature.cc',
'src/repository.cc',
'src/object_cache.cc',
View
@@ -0,0 +1,19 @@
+#include "git_object.h"
+#include "commit.h"
+
+
+namespace gitteh {
+ GitObject::GitObject(git_object *obj) {
+ type_ = git_object_type(obj);
+ git_oid_cpy(&oid_, git_object_id(obj));
+ }
+
+ GitObject::~GitObject() {
+ repo_->disown(this);
+ }
+
+ void GitObject::Init(Repository *repo) {
+ repo_ = repo;
+ repo_->adopt(this);
+ }
+}; // namespace gitteh
View
@@ -7,30 +7,17 @@
#include <git2.h>
namespace gitteh {
- class GitObjectCache;
-
class GitObject : public ObjectWrap {
public:
git_otype type_;
git_oid oid_;
- GitObject(git_object *obj) {
- type_ = git_object_type(obj);
- git_oid_cpy(&oid_, git_object_id(obj));
- }
-
- ~GitObject() {
- repo_->disown(this);
- }
-
- inline void Init(Repository *repo) {
- repo_ = repo;
- repo_->adopt(this);
- }
-
+ GitObject(git_object *obj);
+ ~GitObject();
+ void Init(Repository *repo);
protected:
Repository *repo_;
};
-};
+}; // namespace gitteh
#endif //GITTEH_GIT_OBJECT_H

0 comments on commit d8c187d

Please sign in to comment.