diff --git a/Makefile b/Makefile index b6af23f..cadc9d6 100644 --- a/Makefile +++ b/Makefile @@ -3,13 +3,15 @@ REBAR=$(shell which rebar || echo ./rebar) all: compile ./rebar: - erl -noshell -s inets start \ - -eval 'httpc:request(get, {"http://hg.basho.com/rebar/downloads/rebar", []}, [], [{stream, "./rebar"}])' \ - -s init stop - chmod +x ./rebar + erl -noshell -s inets start \ + -eval 'httpc:request(get, {\ + "http://hg.basho.com/rebar/downloads/rebar", []\ + }, [], [{stream, "./rebar"}])' \ + -s init stop + chmod +x ./rebar compile: $(REBAR) - @$(REBAR) compile + @$(REBAR) compile clean: $(REBAR) - @$(REBAR) clean + @$(REBAR) clean diff --git a/README.md b/README.md index c4db9bf..7403223 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ The API looks basically like this: CONTRIBUTING ============== -Fork schacon/ribbit on GitHub, make it awesomer (preferably in a branch named +Fork schacon/geef on GitHub, make it awesomer (preferably in a branch named for the topic), send a pull request. diff --git a/c_src/geef.c b/c_src/geef.c index 9f63cbe..049cf74 100644 --- a/c_src/geef.c +++ b/c_src/geef.c @@ -1,15 +1,16 @@ #include "erl_nif.h" #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define MAXBUFLEN 1024 @@ -23,7 +24,7 @@ geef_hex_to_raw(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) return enif_make_badarg(env); git_oid oid; - git_oid_mkstr(&oid, sha); + git_oid_fromstr(&oid, sha); ErlNifBinary ibin; enif_alloc_binary(20, &ibin); @@ -49,7 +50,7 @@ geef_object_exists(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) git_odb_open(&odb, path); git_oid oid; - git_oid_mkstr(&oid, sha); + git_oid_fromstr(&oid, sha); int exists = git_odb_exists(odb, &oid); if(exists == 1) { diff --git a/geef b/geef index 7485a95..dfa2057 100755 --- a/geef +++ b/geef @@ -1,4 +1,4 @@ -#!/usr/local/Cellar/erlang/R14B/bin/escript +#!/usr/bin/env escript %% -*- erlang -*- %%! debug verbose -noshell -pa ebin