gitweb: Use --git-dir parameter instead of setting $ENV{'GIT_DIR'}
[gitweb.git] / fetch.c
diff --git a/fetch.c b/fetch.c
index aeb6bf2639cc75b6f738348bcc267179a8a0da65..7d3812c40606a6afad796826dd0937a92f71bc7a 100644 (file)
--- a/fetch.c
+++ b/fetch.c
@@ -84,7 +84,7 @@ static int process_commit(struct commit *commit)
        if (commit->object.flags & COMPLETE)
                return 0;
 
-       memcpy(current_commit_sha1, commit->object.sha1, 20);
+       hashcpy(current_commit_sha1, commit->object.sha1);
 
        pull_say("walk %s\n", sha1_to_hex(commit->object.sha1));
 
@@ -302,8 +302,7 @@ int pull(int targets, char **target, const char **write_ref,
                if (ret)
                        goto unlock_and_fail;
        }
-       if (msg)
-               free(msg);
+       free(msg);
 
        return 0;