Blob.from_file should be the correct thing to use. Perhaps one representation is hex and the other is binary?

Jelmer

On May 19, 2014 5:50:21 AM CEST, Ryan Faulkner <notifications@github.com> wrote:
>> +    """Walk through the index check for differences against working
>tree.
>> +
>> +    :param repo:                repo path or object
>> +    :param tracked_changes:     list of paths already staged
>> +
>> +    :return:                    list of paths not staged
>> +    """
>> +    r = open_repo(repo)
>> +    unstaged_changes = []
>> +    index = r.open_index()
>> +
>> +    # For each entry in the index check the time of last
>modification &
>> +    # ensure not staged
>> +    for entry in index.iteritems():
>> +        statbuf = os.stat(os.path.join(r.path, entry[0]))
>> +        if statbuf.st_mtime > entry[1][0][0]:
>
>Can you point me to the best way to do generate a sha1 via dulwich for
>an untracked modification?  I've tried to user Blob::from_file but it
>doesn't seem to generate the correct sha1 (unmodified file sha1 aren't
>matching what's returned), any ideas?
>
>---
>Reply to this email directly or view it on GitHub:
>https://github.com/jelmer/dulwich/pull/178/files#r12778729